[Q]: Specifying a wildcard search in a SELECT
Posted in 1995
Topics: General Discussion
FOLKS: How do you specify a select so that when it is prepared an "*" is appended to the search criteria with no intervening whitespace? DEFINE a CHAR 10 DEFINE b CHAR 11 DEFINE query1 CHAR(200) ... ASSUME USER INPUTS PARTIAL OR FULL LENGTH OF a and b LET query1 = "SELECT field1, field2, field3 FROM table1", "WHERE field1 = a* AND filed2 = b*" ... PREAPRE AND DECLARE CURSOR..... Basically the value of a and b need to be substituted and the "*" tacked right onto the end with no intervening whitespace. I have heard of using "?" as a place holder but I don't know if that will solve my problem. I also don't quite understand how to implement it in my case. To sumarize. I will know the full or partial values of a and b and will need to do a select which passes the value of a concatenated with an "*" and the value of b concatenated with an "*" also. Any help would be greatly appreciated. TIA, -- Ancil Bethelmy cowboy@ranchero.dcsc.bls.com