Welcome! Log In Create A New Profile

Advanced

What is the wildcard character for a query?

Posted by Dan M 
Dan M
What is the wildcard character for a query?
June 11, 2009 03:57AM
What I mean is, I have a customer table. I want the user to be able to toggle between ALL customers and just there own.

I created a table based on a query to show just there own.

Is there a character I can use to show ALL by replacing their ID with a character that is a wild card and will show all companies with any ID?

or ... is there another/better way of doing this?

Dan
M. Beaven
Re: What is the wildcard character for a query?
June 11, 2009 06:37AM
Hi Dan,

Provided that this is a hyperfile query, you can set the query to use a parameter of customerID. If you want to see all customers, declare the query parameter to be:

myQuery.MyParam=Null

Otherwise, declare the query parameter to be:

myQuery.MyParam=customerID

This is prior to your query execution.

You can "ignore" any query parameter in this sense.

HTH-

Marc
Art Bonds
Re: What is the wildcard character for a query?
June 13, 2009 07:13PM
How would one use a wild card in a query where you want to match a certain pattern?

For example, I have a field (TheFieldname) in a table (TableName) made up of numbers, such as:

123456789
123444444
123555559

I want a query to return rows based upon this query: "Select * from TableName where TheFieldname = 123?????9", which would return the first and third row. Or TheFieldname = 12?4?????, where the first and second rows would be returned.

Its on my agenda to look more closely into it this weekend, but if anybody has done this before I'd appreciate a hint. I imagine it depends on which data base I use (HF, MySQL, Postgresql, etc).
I think the SQL default is '%' and '?' but you would normally use 'like' and not '='.
eg.

"Select * from TableName where TheFieldname like '1234%' etc.

Regards

issah
Art Bonds
Re: What is the wildcard character for a query?
June 13, 2009 08:35PM
So far...

[www.techonthenet.com]

[www.sql-tutorial.net]

In Postgresql, SIMILAR TO and NOT SIMILAR TO, and for case insensitive also ILIKE and NOT ILIKE.

[www.postgresql.org]
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: