?
Solved

How to call Oracle Stored Procedure

Posted on 2008-10-16
4
Medium Priority
?
693 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 74

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 74

Accepted Solution

by:
sdstuber earned 200 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

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 …
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

764 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