On 14/10/2013 12:01 PM, Jeff Johnson wrote:

Frank: I am building a string for SQL Pass through and am getting an error. How would I put that in a string:

lcSQL = 'INSERT INTO DB.TABLE (astringfield, adatefield) VALUES ("' + m.string + '", ?m.MyDateTime)'

What is the error?

I am guessing it is because SQL does not use double quotes, so switch them around like this.

m.lcSQL = "INSERT INTO DB.TABLE (astringfield, adatefield) VALUES ('" + m.string + "', ?m.MyDateTime)"

In order to avoid that I would do:

TEXT TO m.lcSQL NOSHOW TEXTMERGE
INSERT INTO DB.TABLE (astringfield, adatefield) VALUES (?m.string, ?m.MyDateTime)
ENDTEXT

(I made m.string a parameter too)

or

TEXT TO m.lcSQL NOSHOW TEXTMERGE
INSERT INTO DB.TABLE (astringfield, adatefield) VALUES ('<< m.string>>', ?m.MyDateTime)
ENDTEXT



Frank.

Frank Cazabon


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to