Page 1 of 1

quotation marks "" How write to string/query

Posted: Sun Feb 28, 2016 3:05 pm
by Victorio
Hi,

How can I write character " to string ?

I want generate filter query this way :

KN_VLA is name of some database
pomvla is character variable, where is some name to filter in database, for example "SMITH JOHN"
drpx is next part of filter in character string, for example " .AND. AFIELD=10"

I want write this :
cQuery:="rtrim(upper(lat_ibm(left(alltrim(kn_vla),50))))="+pomvla+drpx
but and here and here must be "

in query is this :
rtrim(upper(lat_ibm(left(alltrim(kn_vla),50))))=NAGY .AND. (DRPC=2 .OR. DRPC=3 .OR. DRPC=4)

but I want this
rtrim(upper(lat_ibm(left(alltrim(kn_vla),50))))="NAGY" .AND. (DRPC=2 .OR. DRPC=3 .OR. DRPC=4)

How can I write it ?

In C language was this way to write characters /*, /" ,// and other

Now I an using chr(34), but I mean exist other way. I do not know, if in some other code page on PC (UTF8 or other may be problem with chr34.

Re: quotation marks "" How write to string/query

Posted: Sun Feb 28, 2016 6:43 pm
by rdonnay
There are 2 ways:

Code: Select all

cString := 'This is a string with a "word" quotated'

cString := [This is a string with a "word" quotated and another 'word' single-quotated]

Re: quotation marks "" How write to string/query

Posted: Mon Feb 29, 2016 3:12 am
by Victorio
Thank you