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: where JOB_ID IN (:JOB_ID)

Re: where JOB_ID IN (:JOB_ID)

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Tue, 5 Sep 2006 18:31:14 GMT
Message-ID: <J54u44.C27@igsrsparc2.er.usgs.gov>


probashi wrote:
> Hi,
>
> When I run q1 I get back 10 rows but when I run q2 (whit supplying
> "'IT_PROG', 'FI_ACCOUNT'" in the parameter) I got zero records
> back.
>
> Can any body explain this!!!.
>
>
> --q1:
> select * from HR.EMPLOYEES where JOB_ID IN ('IT_PROG', 'FI_ACCOUNT')
>
> --q2
> select * from HR.EMPLOYEES where JOB_ID IN (:JOB_ID)
>
> Thanks
>

In Q2, ":JOB_ID" is a bind variable. This bind variable can only be used to return one value in the IN clause. If you need two values in the IN clause (as shown in Q1), then you need to have 2 bind variables, holding the two different values you are searching for.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Tue Sep 05 2006 - 13:31:14 CDT

Original text of this message

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