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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Select * from Table 1 where Col1 in (VARIABLE1) inside a stored proc.

Re: Select * from Table 1 where Col1 in (VARIABLE1) inside a stored proc.

From: Job <Job_at_pestilence.net>
Date: 2000/05/03
Message-ID: <39100AF4.89F23844@pestilence.net>#1/1

Muon Ngu wrote:

> I have a simple stored procedure, that I would like to have a passed in
> string(varchar2) for used in select from where col1 in (var1) in a stored

What exactly are you putting into the input string? Are you dealing with quotes correctly - it looks like you have a list of values in the string? If so maybe you should get them from a table within the stored proc and use a join, e.g.

FROM SREVSECT a, other_table b
WHERE a.sectno = b .SectNos

or, if you really have only one value in the input string just use

where sectno = pSectNos

Again - what's in the input string? Any trailing or leading characters?

>
> procedure. I've tried everything but doesn't work. Followed is my proc.
>
> Thanks
>
> CREATE OR REPLACE PROCEDURE WSREVSECT_5
>
> pSectNos varchar2,
> pRetCode OUT varchar2
> )
> AS
> nCount number;
>
> BEGIN
>
> SELECT count(fksrev) into nCount
> FROM SREVSECT
> WHERE sectno IN (pSectNos ) /* as in 'abc', 'xyz', '012' */
> ;
> pRetCode:=to_char(ncount);
>
> End;
Received on Wed May 03 2000 - 00:00:00 CDT

Original text of this message

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