Seems I didn't try hard enough, how to build string values, old habits is 
sometimes hard to get rid of .
I appreciate all suggestions how to solve my "hard" :-) problem 
I will use Jeremys (and others) suggestion,together with Jon's suggestion of 
using array and makestring.
Ended up with this  for the NULL value, (which also deals with embedded single 
quotes in value)

::Routine esc
use arg thing
if thing == .nil then return "NULL"

return "'"|| thing~changestr("'","''") ||"'" 


 /hex

----- Ursprungligt Meddelande -----
Från: Sahananda (Jon) Wolfers <[email protected]>
Till: Open Object Rexx Developer Mailing List 
<[email protected]>
Kopia:
Datum: fredag, 22 juni 2012 08:39
Ämne: Re: [Oorexx-devel] ooSQLite NULL value ?
I've nothing useful to say about handling nulls, but when it comes to building 
strings of values I have come to enjoy the makestring argument of the array 
class with a parm of 'l'.  Probably not everyone's cup of tea, but I have found 
it useful when building queries on the fly.

You prepare for your query like this...


cols =  .array~new
vals = .array~new

.. add columns and data like this ...


cols~append('col1')
vals~append(encapsulate(col1))


...and finally render your query like this...


stmt = "INSERT INTO table ("cols~makearray('l',',')") 
value("vals~makearray('l',',')");"


Jon



On 21 June 2012 22:52, Jeremy Nicoll - ml sourceforge 
<[email protected]> wrote:
Mark Miesfeld <[email protected]> wrote:

> I'm just saying I think its place is in the application, or a higher level
> class that uses .ooSQLite.


I think the same.


> Not sure if you know that you could use this syntax in ooRexx, or that you
> would like it:


> stmt ||= encapsulate(col1) || ","

Didn't know; not sure if I like it...


--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
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





------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
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

Reply via email to