Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: fetchrow_hashref Not returning Dates

by astroboy (Chaplain)
on Sep 03, 2009 at 02:00 UTC ( #793073=note: print w/ replies, xml ) Need Help??


in reply to fetchrow_hashref Not returning Dates

It would be most useful if you provided

  1. Your SQL
  2. A dump of $lhref using Data::Dumper or similar

I suspect that you'll find that your column names will include the to_char function:

SQL> select to_char(sysdate, 'DD-MON-YYYY') from dual; TO_CHAR(SYS ----------- 03-SEP-2009

Although I don't know your code or SQL, I suspect you'll need to provide an alias for your column (most likely the original column name if that's what you're referring to in your code):

SQL> select to_char(sysdate, 'DD-MON-YYYY') "sysdate" from dual; sysdate ----------- 03-SEP-2009


Comment on Re: fetchrow_hashref Not returning Dates
Select or Download Code
Re^2: fetchrow_hashref Not returning Dates
by Anonymous Monk on Sep 03, 2009 at 16:52 UTC

    "I suspect that you'll find that your column names will include the to_char function:"

    Thanks, astroboy! This is exactly what was happening and I don't know why I didn't think to just print out the hash to investigate. (I guess it had something to do with getting less than 6 hours of sleep the night before.) The SELECT statement looked like this:

    SELECT granule_name, path, to_char(start_date, 'yyyymmddhh24miss'), to +_char(stop_date, 'yyyymmddhh24miss'), byte_size, num_passes, browse_a +vail FROM $invName WHERE $pclause $sclause $suffix

    The key/value pairs look like this:

    granule_name f15_grid_2009.243_dayAD.eos path 2009/f15_grid_2009.243_dayAD.eos to_char(stop_date,'yyyymmddhh24miss') 20090901004308 to_char(start_date,'yyyymmddhh24miss') 20090831000749 byte_size 4888111 num_passes 29 browse_avail Y
      I've got the same issue, but unfortunately, I don't have access to the stored procedure that is formatting the dates. Other than the alias, is there a way to get the data when the returned key is balled up with the to_char?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://793073]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-07-29 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (228 votes), past polls