Thanks Igor, >> I am asking this because julianday(date('1984-03-03')) = >> julianday('1984-03-03'). Right? > > Right. In fact, date('1984-03-03') is a no-op: the result of > date('1984-03-03') is simply '1984-03-03'. Though I fail to see how this > fact is relevant to your original question.
I had a doubt that date('1984-03-03') might take some reasonable amount of time, where I am using this date funtion just for the sake of date('now'). I did not know julianday('now') is supported. One more question, We have developed an App that was written for Version 3.1.3 available in Mac OS 10.4. Now I have to move all the sqlite_exec to prepare/step/finalize methods, but as per the documents, it says 'use of sqlite_prepare is not recommended' Is sqlite_prepare supported in 3.1.3? If not, I seems there is no other option than to move to 3.3.9 & above. Thanks for you valuable time, Bharath On 6/6/08 5:33 PM, "Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > "Bharath Booshan L" > <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >> 1. Can I use sqlite3_prepare_v2 in Version 3.1.3? > > No. It was introduced in v3.3.9 > >> 2. How do I bind date values using prepare/bind methods? > > SQLite doesn't have dedicated date or time types. You may choose to > store timestamps as strings, as julian dates (floating point numbers) or > as Unix epoch timestamps (integers). See also > > http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions > >> Eg: INSERT INTO TABLE Info(Name,DOB) >> values('XYZ',julianday('1984-03-03')); >> >> For above example I can write a prepared statement as >> >> INSERT INTO TABLE Info(Name,DOB) values(?,julianday(?)) > > Here, you are replacing two string literals with parameter placeholders. > So you bind them as strings. > >> But how do I write prepared statement if I want to insert date('now') >> value into the table, like below query >> >> INSERT INTO TABLE Info(Name,DOB) values('XYZ',julianday(date('now')) > > julianday('now') would work just as well. So you can use your first > statement, and bind 'now' for the parameter. > >> I am asking this because julianday(date('1984-03-03')) = >> julianday('1984-03-03'). Right? > > Right. In fact, date('1984-03-03') is a no-op: the result of > date('1984-03-03') is simply '1984-03-03'. Though I fail to see how this > fact is relevant to your original question. > > Igor Tandetnik > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ----------------------------------------------- Robosoft Technologies - Come home to Technology Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users