On Thu, Jun 21, 2012 at 1:58 PM, Jeremy Nicoll - ml sourceforge <
[email protected]> wrote:
> hakan <[email protected]> wrote:
>
> > using INSERT INTO table (col1,col2,col3) value( 'value1 ' , NULL , '
> > value3 '); ...
>
> all you need to do is create a function which
> returns the quoted value of all values except .nil (or whatever you use in
> your program to represent a null), and return "NULL" otherwise, eg
>
> stmt = "INSERT INTO table (col1,col2,col3) value("
> stmt = stmt || encapsulate(col1) || ","
> stmt = stmt || encapsulate(col2) || ","
> stmt = stmt || encapsulate(col3) || ")"
>
>
Yes, I agree with that. I'm just saying I think its place is in the
application, or a higher level class that uses .ooSQLite.
Not sure if you know that you could use this syntax in ooRexx, or that you
would like it:
stmt = "INSERT INTO table (col1,col2,col3) value("
stmt ||= encapsulate(col1) || ","
stmt ||= encapsulate(col2) || ","
stmt ||= encapsulate(col3) || ")"
I find it useful.
--
Mark Miesfeld
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel