Using Tilde variable in query HELP

Using Tilde variable in query HELP

Post by marlo.. » Thu, 30 Dec 1999 04:00:00



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.deja.com/
Before you buy.

 
 
 

Using Tilde variable in query HELP

Post by Ken Loom » Thu, 30 Dec 1999 04:00:00



>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.


 
 
 

Using Tilde variable in query HELP

Post by Steve Urba » Thu, 30 Dec 1999 04:00:00




>>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
 
 
 

Using Tilde variable in query HELP

Post by Steve Gree » Thu, 30 Dec 1999 04:00:00



> 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

 
 
 

Using Tilde variable in query HELP

Post by Mark Knau » Sat, 01 Jan 2000 04:00:00


I once had a last name of Blank in a database.


> > 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


 
 
 

1. Using Tilde (~) variable in query

Has anyone had a problem using the tilde variable in a query?  I have a database field that has organization names in it such as:

Borland International, Inc.

The comma really messes up my query's search of the database and returns an empty answer table although I can see that there are
records out there that it should be hitting on.  

When I hard code the name of the organization I am searching for in a query, it works fine.  But when the ~ tries to pick up the
inputted organization the query finds nothing.

Thx in advance.

2. Access Problem

3. using tilde variables in SQL VARIABLES

4. ADO error after re-install of Office

5. Tilde variable in query HELP

6. !!NEW: TELNET SITES GET GRAPHICS

7. Help with query strings and tilde variables in PDOXWIN

8. Y2K anomoly in a query.

9. Tilde variable query advice?

10. ~Tilde Variables in Queries

11. Tilde variable & Query ReadFromFile

12. Query readFromFile and tilde variables

13. Date Tilde Variable in Query