How to Use Wildcards In IDC FilesID: Q147361
|
When you use the Internet Database Connector (IDC) to query data from an ODBC database, you may need to use wild-cards in your SQL statements in the IDC file. The ODBC wildcard character is the percent (%) sign. After you set up an HTML query form, make sure that the percent (%) sign is entered in the query data.
If you do not want to instruct users to add the wildcard character to
their queries, you can add the wildcard to the query data in the IDC file.
In an IDC file, the single percent (%) sign is used to delimit the
variables that are passed to it from the HTML form. Therefore, use two
percent signs (%%) to insert the wild-card.
For example, given a form defined like this:
<FORM METHOD="POST" ACTION="/scripts/getprod.idc">
<P>Enter Name of product: <INPUT NAME="prdname">
<P><INPUT TYPE="SUBMIT" VALUE="Run Query">
</FORM>
SQLStatement:
+ SELECT * from products
+ where prod_name like '%prdname%%%'
SELECT * from products where prod_name like 'paper%'
Additional query words: prodiis wildcard
Keywords : kbnetwork iisodbc iishowto
Version : 1.0
Platform : WINDOWS
Issue type :
Last Reviewed: May 4, 1999