Solved

How to call Oracle Stored Procedure

Posted on 2008-10-16
4
687 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 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 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

821 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