in reply to Re^4: DBI, and date type SQLite
in thread DBI, and date type SQLite
Disclaimer : I'm neither a DBA nor a DBI expert but...
It seems to me that the binding for "ORDER BY xxx", the xxx needs to be a FIELD-NAME, not a value, so, the resolution of the variable at that location should be completed before the "prepare" is executed. In other words, I don't think that can be bound to a "?" for "execute-time" binding.
Other style comments : (You did not ask, but this is a perl website, and sometimes we provide unsolicited advice that you are free to reject):
In your table row filling code, you add "\n", which will be ignored in HTML. I would suggest:
(Untested)print $q->start_table({-border=>'1', -align=>'center',-cellpadding=>'6'} +),"\n\n"; while ( @data = $sth->fetchrow_array()){ print $q->start_Tr,"\n", # This '\n' is useful only in case someone read +s the HTML source map ({ td({-align=>'left'},decode("utf-8",$_) )."\n" } @data), $q->end_Tr,"\n"; } print $q->end_table,"\n";
Another thing that would help is if you provided the SQL schema, including just a few records of your Sqlite db, so that we could recreate your problem.
Also, passing along something I just learned:
the parameter for 'julianday' is TEXT, not a 'DATE' type. Hopefully, your sqlite database has the fields defined as TEXT fields, and the bind parameter is also a date in text form.
In my tests, the dash (-) separator works, but slash (/) does not.
"XML is like violence: if it doesn't solve your problem, use more."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: DBI, and date type SQLite
by NetWallah (Canon) on Oct 10, 2011 at 06:08 UTC | |
by Corion (Patriarch) on Oct 10, 2011 at 06:25 UTC | |
by nando (Acolyte) on Oct 10, 2011 at 06:52 UTC |