[REBOL] date! and SQL..
From: chris::starforge::co::uk at: 11-Jul-2001 19:44
Hi,
Probably a rather stupid question to ask, but I prefer to be sure....
I've been playing around with Doc Kimbel's mySQL scheme and noticed in
the usage doc "String! datatypes will be escaped, all others types will be
MOLDed ! (So, watch out when working with types like date! !)". Is this still
true? (ie: the latest version doesn't do type conversion for inserts) If so
is doing something like
>> to-sql-date: func [
[ "Convert REBOL date (dd-mmm-yyyy) to SQL (yyyy-mm-dd) format"
[ source [date!] "date to convert"
[ ][
[ rejoin [source/year "-" source/month "-" source/day]
[ ]
>> insert db ["insert into test values (?,?)" "Entry1" to-sql-date now/date]
the correct way to go about inserting with dates?
Chris