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 > call storedproc returns output parameter not a bind variable

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-23-03, 05:16
ronq ronq is offline
Registered User
 
Join Date: Jan 2003
Posts: 2
call storedproc returns output parameter not a bind variable

Hello,

i'm new in oracle pl/sql and sql*plus and have following problem:

i created a stored procedure with one input and with one output parameter.

i want to try the procedure in sql*plus, but the call returns "ORA-06577: output parameter not a bind variable".

Code of stored procedure looks like this:

CREATE OR REPLACE PROCEDURE GET_SEQUENCE (
tablename IN VARCHAR2,
sequence_no OUT NUMBER) IS
Begin
IF tablename = 'table1' THEN
SELECT sequence_table1.nextval INTO sequence_no from DUAL;
END IF;
IF tablename = 'table2' THEN
SELECT sequence_table2.nextval INTO sequence_no from DUAL;
END IF;

....

End;



how do i write the call statement to get the sequence number?
e.g.: "call GET_SEQUENCE('table1',?)"


thanks for any help.
ronq
Reply With Quote
  #2 (permalink)  
Old 01-23-03, 06:25
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: call storedproc returns output parameter not a bind variable

Do this:

VARIABLE seqno NUMBER

EXEC GET_SEQUENCE('table1',:seqno)

By the way, your code would be more efficient if you used ELSIF:

IF tablename = 'table1' THEN
SELECT sequence_table1.nextval INTO sequence_no from DUAL;
ELSIF tablename = 'table2' THEN
SELECT sequence_table2.nextval INTO sequence_no from DUAL;
END IF;

(or you could use a CASE statement).
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 01-23-03, 06:49
ronq ronq is offline
Registered User
 
Join Date: Jan 2003
Posts: 2
Re: call storedproc returns output parameter not a bind variable

Thanks, it works.

ronq
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