>Using SQL Server, I am preparing the update line in a string and then using that string to update some fields for the record. I am using the single quote to encapsulate the value. However, sometimes, I can have a single quote in the value. So, I decided to do something like this: ... SET FIELD1='First part'+CHR(39)+'second part'...
>
>However, SQL Server does not understand CHR().
Whenever a single quote occurs in the string , stuff it with another single quote.
******* here is the code
xxx = " This is my sample ' quote "
xxx = strtran(xxx,"'","''")
dynqry = "Update mytable set field1 = " + xxx
?sqlexec(Gnconnhandle,dynqry,'MyCursor')
return
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only