Solved

PLS-00049: bad bind variable when calling stored procedure

Posted on 2009-05-07
3
2,330 Views
Last Modified: 2013-12-19
I am trying to call a stored procedure from within an existing Oracle stored procedure.  The stored procedure I am attempting to call returns a ref cursor.  The issue I encountered is I can't seem to define the ref cursor variable I need to pass to the stored procedure correctly.  I keep getting the error:  "PLS-0049:  bad bind variable".  See below code example.

Any help you could provide would be greatly appreciated.
Procedure Some_Procedure IS

x ref_cursor;
 

Begin
 

  Other_Proc('1','2','3','4',:x);
 

End Some_Procedure;
 

-- Other Procs in/out variables

Procedure Other_Proc

(

var1  varchar2,

var2  varchar2,

var3  varchar2,

var4  varchar2,

P_CURSOR  IN OUT   RET_REFCURSOR);

Open in new window

0
Comment
Question by:DCG_Developer
  • 2
3 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 250 total points
Comment Utility
remove the colon in front of x in your call.

Procedure Some_Procedure IS
x ref_cursor;
 
Begin
 
  Other_Proc('1','2','3','4',x);
 
End Some_Procedure;
0
 

Author Comment

by:DCG_Developer
Comment Utility
Thanks, can't believe I missed that.
0
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
no problem, glad I could help
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now