Hi

I would like to help you, but you need to give some extra information. What is the exact perl module you are using: DBI, Class::DBI, DBIx::Class ... ? And on what kind of databank are you running: Postgresql, Oracle, mySQL ... ? And what is the exact output resulting from print statement: an error, a string with nothing in, something like HASHx.., ... ?

In my experience, the problem is often the correct use of the quotations in the statement. For example, when using mySQL, if find using backtick quotes ` on every column a good rule to avoid problems. Also use the qq{} notation to avoid any change of misinterpretation by perl when parsing your select statement, especially when using using variables (which you are not doing here, but better save than sorry).

So, try once:

my $sth = $db_h->Query(qq{ SELECT `serial_num`, FROM_UNIXTIME(`trans_date`) AS `Action_date +`, `actor`, `type`, `trans_data`, `content` FROM `transtable` ORDER B +Y `serial_num`; });

Kind Regards

Martell

update:

Try first the suggestion of rev_1318 below. Didn't spot the issue in his remark, but after reading it, I think he's right.


In reply to Re: Problem converting with FROM_UNIXTIME by martell
in thread Problem converting with FROM_UNIXTIME by ibra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.