If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Pls-00383 (select Where ... In)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-03, 12:41
austrian_ead austrian_ead is offline
Registered User
 
Join Date: Jan 2003
Posts: 14
Question Pls-00383 (select Where ... In)

Hello,

I am having a problem that is easy to solve for an experienced professional.

Here it is: I have to develop a stored procedure where there's an input parameter of the varchar2-type which contains several values, separated by a comma.

A typical case would look like this: sTestPar := 'a23,b56,c78,d64'

As a MS-SQL-Server Programmer, I tried the following:

insert into teamdaten
(NTUser)
select
Username
from
Authentication
where
aktive=1 and NTGroup in (sTestPar);

Failure. In Oracle I only can put one Value in it.

So, I tried to put the Values into a collection like VARRAY or PL/SQL-Table.


TYPE recTestParType is table of authentication.NTGroup%type index by binary_integer;
recTestPar recTestParType;

insert into teamdaten
(NTUser)
select
Username
from
Authentication
where
aktive=1 and NTGroup in (recTestPar);

Failure: PLS-00383

It is possible to put a single value from the PL/SQL-Table there (recTestPar(1)) but not the whole Table.

Then I tried the VARRAY -> same Error

Has anyone got any Ideas how to solve the Problem? I am new in making SP for Oracle and got into lots of troubles but this was not solvable for me
Reply With Quote
  #2 (permalink)  
Old 01-28-03, 12:58
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Pls-00383 (select Where ... In)

This can be done, but is a little tricky. This links explains how:

http://asktom.oracle.com/pls/ask/f?p...D:146012348066
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 01-28-03, 13:52
austrian_ead austrian_ead is offline
Registered User
 
Join Date: Jan 2003
Posts: 14
Re: Pls-00383 (select Where ... In)

Hi Andrewst,

it works, thanks a lot for the quick help!

I don't know, if my brain really checks that, but for today it's ok :-)
(it was another long day)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On