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: <bonanos_at_yahoo.com>
Date: Thu, 02 Jul 1998 09:41:31 GMT
Message-ID: <6nfkka$39r$1@nnrp1.dejanews.com>

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

You could also code the % in your procedure eg:

cursor blah is

select * .... .... where sic like name || '%'

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Jul 02 1998 - 04:41:31 CDT

Original text of this message

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