Using Tilde variable in query HELP 
Author Message
 Using Tilde variable in query HELP

Hello everyone,
In ObjectPal i'm using a query with a ~tilde variable.
If i assign the varibale with something like this: var="John, H"
the query result will be empty.

Query
Table  |  Name          |
       |CheckPlus ~var  |

After some search i discovered that the comma will be seen as an
operator. That's why the query will have no result even if the name
"John, H" appears in the table.
Is there any workaround for this problem? i tried several thing, but no
result.
thanks in advance,
Marlon

Sent via Deja.com http://www.***.com/
Before you buy.



Sun, 16 Jun 2002 03:00:00 GMT
 Using Tilde variable in query HELP

Quote:

>Hello everyone,
>In ObjectPal i'm using a query with a ~tilde variable.
>If i assign the varibale with something like this: var="John, H"
>the query result will be empty.

>Query
>Table  |  Name          |
>       |CheckPlus ~var  |

>After some search i discovered that the comma will be seen as an
>operator. That's why the query will have no result even if the name
>"John, H" appears in the table.
>Is there any workaround for this problem? i tried several thing, but no
>result.
>thanks in advance,
>Marlon

Put a backslash before any reserved character to render it literal.
Such as: "John\, H"  

You would need to do this with quotes, plus symbols, backslashes
themselves, etc.

Good luck!

Ken

- Show quoted text -

Quote:

>Sent via Deja.com http://www.deja.com/
>Before you buy.



Sun, 16 Jun 2002 03:00:00 GMT
 Using Tilde variable in query HELP

Quote:


>>Hello everyone,
>>In ObjectPal i'm using a query with a ~tilde variable.
>>If i assign the varibale with something like this: var="John, H"
>>the query result will be empty.

>>Query
>>Table  |  Name          |
>>       |CheckPlus ~var  |

>>After some search i discovered that the comma will be seen as an
>>operator. That's why the query will have no result even if the name
>>"John, H" appears in the table.
>>Is there any workaround for this problem? i tried several thing, but no
>>result.
>>thanks in advance,
>>Marlon

>Put a backslash before any reserved character to render it literal.
>Such as: "John\, H"  

If you are using PDOXDOS 4.5, look at the command QUOTESTRING in the
Upgrade Guide or roll your own "quoter"

Steve U

Quote:

>You would need to do this with quotes, plus symbols, backslashes
>themselves, etc.

>Good luck!

>Ken

>>Sent via Deja.com http://www.deja.com/
>>Before you buy.

,        _
,       | \                           Steve Urbach
,       |  )erek

,  / / /                              http://www.greenduck.com


Sun, 16 Jun 2002 03:00:00 GMT
 Using Tilde variable in query HELP

Quote:

> In ObjectPal i'm using a query with a ~tilde variable.
> If i assign the varibale with something like this: var="John, H"
> the query result will be empty.

the other responses are close, but no cigar.. the *whole* string must
itself start and end with quotes (as if you typed it in that way) and the
query processor will deal with the string as-is.. in this case:

var = "\"John, H\""

this is actually a common issue.. two state abbreviations are OR for Oregon
and AS for American Samoa.. consider the problems querying for those values
in a [State] field.. it's the exact same thing you are faced with..

--
Steve Green
Corel CTech - Paradox
Diamond Software Group, Inc.
Waldorf, Maryland  USA

http://www.diamondsg.com



Sun, 16 Jun 2002 03:00:00 GMT
 Using Tilde variable in query HELP
I once had a last name of Blank in a database.
Quote:


> > In ObjectPal i'm using a query with a ~tilde variable.
> > If i assign the varibale with something like this: var="John, H"
> > the query result will be empty.

> the other responses are close, but no cigar.. the *whole* string must
> itself start and end with quotes (as if you typed it in that way) and the
> query processor will deal with the string as-is.. in this case:

> var = "\"John, H\""

> this is actually a common issue.. two state abbreviations are OR for Oregon
> and AS for American Samoa.. consider the problems querying for those values
> in a [State] field.. it's the exact same thing you are faced with..

> --
> Steve Green
> Corel CTech - Paradox
> Diamond Software Group, Inc.
> Waldorf, Maryland  USA

> http://www.diamondsg.com




Tue, 18 Jun 2002 03:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Using Tilde (~) variable in query

2. using tilde variables in SQL VARIABLES

3. Tilde variable in query HELP

4. Help with query strings and tilde variables in PDOXWIN

5. Tilde variable query advice?

6. ~Tilde Variables in Queries

7. Tilde variable & Query ReadFromFile

8. Query readFromFile and tilde variables

9. Date Tilde Variable in Query

10. tilde variable in a query

11. Problems Using Tilde variables in Paradox 7

12. Using tilde variable in SQL


 
Powered by phpBB® Forum Software