>Hi Cetin...
>
>In the previous example, the ? was a type which I forgot to add. Let me give you
>another example listed below:
>
>*--
>lnUnt_ship = 10
>lcOrd_numb = '1234'
>lcItem_numb = 'TEST"
>lcItm_desc = "Brackets [1/2)"
>
>lcSQL = "UPDATE cOrders SET " + ;
> "unt_ship = unt_ship + " + TRANSFORM(lnUnt_ship) + ", " +;
> "WHERE ord_numb = [" + lcOrd_numb + "] AND itm_numb = [" + lcItm_numb + "] "
>=SQLEXEC(gnC, lcSQL)
>*--
>
>In the example above, the brackets in the lcItm_desc breakes the statement and causes a syntax error. How can I avoid this...
>
>Thank you again
>Raz
SQL Server recognize only apostrophes as string unless SET QUOTED_IDENTIFIER is OFF. Then it will accept double quotes as delimiter. You must change your string to:
TEXT TO lcSQL NOSHOW TEXTMERGE
UPDATE cOrders SET unt_ship = unt_ship + <<lnUnt_ship>>
WHERE ord_numb = '<<lcOrd_numb>>' AND itm_numb = '<<lcItm_numb>>'
ENDTEXT
or:
lcSQL = "UPDATE cOrders SET unt_ship = unt_ship + " + TRANSFORM(lnUnt_ship) +;
" WHERE ord_numb = '" + lcOrd_numb + "' AND itm_numb = '" + lcItm_numb + "'"
or:
lcSQL = "UPDATE cOrders SET unt_ship = unt_ship + ?lnUnt_ship"+;
" WHERE ord_numb = ?lcOrd_numb AND itm_numb = ?lcItm_numb"
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.