Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 694
  • Last Modified:

How to call Oracle Stored Procedure

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
claghorn
Asked:
claghorn
  • 2
  • 2
1 Solution
 
sdstuberCommented:
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
 
claghornAuthor Commented:
I'm using microsoft .net oracle development tools. Its saying the procedure name needs to be declared.
0
 
claghornAuthor Commented:
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
 
sdstuberCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now