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: Help Please

Re: Help Please

From: Markus Stuhlpfarrer <mstuhlpfarrer_at_hollomey.com>
Date: Mon, 16 Jul 2001 06:24:55 GMT
Message-ID: <3B52A4C0.93234AFB@hollomey.com>

no, you can't use a string there, it is only possible to pass an array, but in most cases that is
not possible too, that depends on where you are calling the procedure from.
it only works from java or another PL/SQL routine. i think that they beste way to do this is to put a seperator and make an instr that searches for the
seperator too

EXECUTE package.procedure ('X1,X2,X3')

inside the procedure:

select field_1, field_2
from table
where instr(','||argument_passed_to_the_procedure||',' , ','|| field_2||',')>0

i piped the ',' in front and in the end, to ensure that it only matches the exact string
oitherwise 'X' would match on 'X1' too because it is in it in this example ',X,' is NOT found in ',X1,X2,X3,'

Baba Yetunde wrote:

> I would like to pass a literal to a procedure in a package.
>
> i.e EXECUTE package.procedure (' ''X1'', ''X2'', '' X3'' ')
>
> inside the procedure, I have a cursor which states:-
> select field_1, field_2
> from table
> where field_2 IN (argument_passed_to_the_procedure)
>
> Is it possible to pass a sting here?
>
> Anyhelp please
Received on Mon Jul 16 2001 - 01:24:55 CDT

Original text of this message

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