Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how do I pass the wildcard operator with a bind variable?

Re: how do I pass the wildcard operator with a bind variable?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 02 Jul 1998 01:21:10 GMT
Message-ID: <359edfda.1700975@192.86.155.100>


A copy of this was sent to Eric Schlene <eschlene_at_purdue.edu> (if that email address didn't require changing) On Wed, 01 Jul 1998 16:08:04 -0500, you wrote:

>I'm querying my database via the web using a stored procedure that
>accepts parameter arguments bound to variables within the select
>string. Specifically, my calling HTML form sends a five-character ZIP
>code string parameter. And it is evaluated in the where clause, ala
>"WHERE address.zip_code LIKE :zip"
>
>Ideally, I'd like the user to be able to enter a partial ZIP code, e.g.,
>"902" , and get back all 902xx hits. Unfortunately, I don't seem to be
>able to pass the "%" sign in the URL.
>

To pass a % in the URL, you need to pass %25...

The browser should be encoding this for you though up on the way up. If you put it in a link (on the server side, in an href tag for example) you must URL encode it (along with other special characters) using a % followed by the HEX representation of the ascii code for that character. For example, ~ is ascii 126 which is hex 7E. To pass a ~ in a URL you should really send %7E..

>I've come up with a hack using single character wildcards, like this...
>RPAD(RTRIM(:zip),5,''_''). But the response time is unacceptable.
>
>Anyone have a great idea on how to do this?
>
>Thanks!
>
>Eric
>
>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Jul 01 1998 - 20:21:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US