Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Need help in Perl DBI (SQLite) execute behaviour

by sam_bakki (Pilgrim)
on Jul 13, 2013 at 12:49 UTC ( #1044147=note: print w/replies, xml ) Need Help??


in reply to Re: Need help in Perl DBI (SQLite) execute behaviour
in thread Need help in Perl DBI (SQLite) execute behaviour

Hi poj

Great. This works as expected. From DBI doc, I understand that DBI will do the type conversion for me from scalar automatically. Looks like in this case I need to do it manually. But why only for RHS? because LHS is doing addition, so it is converted to INTEGER automatically?

Thanks :)



Thanks & Regards,
Bakkiaraj M
My Perl Gtk2 technology demo project - http://code.google.com/p/saaral-soft-search-spider/ , contributions are welcome.

Replies are listed 'Best First'.
Re^3: Need help in Perl DBI (SQLite) execute behaviour
by poj (Prior) on Jul 13, 2013 at 15:42 UTC
    Is your database field creationTime type INTEGER ?.

    You might find this statement works

    DELETE FROM session WHERE creationTime < ?

    if you make the parameter

    (time() - SESSION_MAX_LIFE_TIME)

    which I think is easier to understand

    poj

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044147]
help
Chatterbox?
[erix]: still doesn't work?
[afoken]: sorry, forget File::BOM. I did not see DBD.
[ELISHEVA]: perldoc - of course
[erix]: hm, where's tux when you need him?
[ELISHEVA]: what's curiouser is that the underlying Text::CSV_XS appears to be BOM-friendly
[afoken]: DBD::CSV has a csv_class attribute. You could subclass Text::CSV_XS to handle BOMs, e.g. through File::BOM.
[ELISHEVA]: Text::CSV_XS already can handle boms - see its detect_bom flag
[ELISHEVA]: but it seems that the DBD::CSV layer on top of it doesn't
[afoken]: Also: All other attributes that start with csv_ and are not described above will be passed to Text::CSV_XS (without the csv_ prefix).
[Discipulus]: what about a good 'ol SOPW?

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-05-28 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?