Solved

How to call Oracle Stored Procedure

Posted on 2008-10-16
4
681 Views
Last Modified: 2013-12-07
How do I call an Oracle Stored Prodeure from a query window. (not using sql plus)
It has one out parameter number type. 2 in parameters both varchar type.
0
Comment
Question by:claghorn
  • 2
  • 2
4 Comments
 
LVL 73

Expert Comment

by:sdstuber
ID: 22733268
what tool are you using that has a query window?

toad, pl/sql developer, sql developer, etc.  will allow you to run an anonymous pl/sql block.

something like this...
declare
    v_out number;
begin
    your_procedure('param1','param2',v_out);
    dbms_output.put_line(v_out);
end;

Open in new window

0
 

Author Comment

by:claghorn
ID: 22733377
I'm using microsoft .net oracle development tools. Its saying the procedure name needs to be declared.
0
 

Author Comment

by:claghorn
ID: 22733441
Also, dbms_output.put_line does not work.
ERROR
ORA-00900: invalid SQL statement
So I try  set serveroutput on;
ERROR
ORA-00922: missing or invalid option
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 50 total points
ID: 22733649
if your procedure is in a package you need to prefix the procedure name with the package name.
similarly, if the procedure/package is in another schema and you don't have a synonym you have to prefix it with the schema name too.

and finally, if you don't have privileges to execute the procedure, it will also return that message.

"set serveroutput on"  is a sqlplus command,  you will use dbms_output.enable
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I rollback insert statements after commit in oracle? 7 124
Can't Access My Database 57 63
Repeat query 13 46
Oracle - SQL Query with Function 3 34
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

786 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