Home » SQL & PL/SQL » SQL & PL/SQL » how ro execute package in sql*plus
how ro execute package in sql*plus [message #10849] Fri, 20 February 2004 05:48 Go to next message
Jeff
Messages: 63
Registered: July 1999
Member
I'm vb user and have to call oracle package.
I've got ora-06550, wrong number or types of arguments.
How can I call this package from sql*plus in order to check this package.

 

thanks
Re: how ro execute package in sql*plus [message #10850 is a reply to message #10849] Fri, 20 February 2004 06:23 Go to previous messageGo to next message
Thomas G
Messages: 58
Registered: April 2003
Member
quite simple :

execute [package].[function or procedure](arg1, arg2,...);


For example

execute mypackage.myfunction("yadda",3);


Good Luck ;-)
Re: how ro execute package in sql*plus [message #10851 is a reply to message #10849] Fri, 20 February 2004 06:59 Go to previous messageGo to next message
Jeff
Messages: 63
Registered: July 1999
Member
I have two parameters, one - input , ID_ORDER,
and second output - O_RESULT_SET OUT CURSOR_TYPE,
when I execute like
execute WRONG_ORDER.GET_IDS(476878,O_RESULT_SET);
I've got error,
identifier 'O_RESULT_SET' must be declared

Thanks.
Re: how ro execute package in sql*plus [message #10853 is a reply to message #10851] Fri, 20 February 2004 07:20 Go to previous messageGo to next message
Jitendra Agrawal
Messages: 71
Registered: December 2003
Member
Hi,

Try following :

declare
ID_ORDER IN NUMBER := 476878,
O_RESULT_SET OUT CURSOR_TYPE
begin
WRONG_ORDER.GET_IDS(IN_ORDER,O_RESULT_SET)
--do operations with cursor type
end;

Regards,
Jitendra Agrawal

http://www.telemune.com/
Re: how ro execute package in sql*plus [message #10854 is a reply to message #10851] Fri, 20 February 2004 07:34 Go to previous messageGo to next message
Jeff
Messages: 63
Registered: July 1999
Member
Doesn't work
PLS-00103: Encountered the symbol "IN"

Thanks.
Re: how ro execute package in sql*plus [message #10856 is a reply to message #10854] Fri, 20 February 2004 08:05 Go to previous messageGo to next message
Jitendra Agrawal
Messages: 71
Registered: December 2003
Member
oops.. remove the IN and OUT words..
Re: how ro execute package in sql*plus [message #10857 is a reply to message #10849] Fri, 20 February 2004 08:18 Go to previous messageGo to next message
Jeff
Messages: 63
Registered: July 1999
Member
I created this procedure:
create or replace procedure test_order
as
TYPE CURSOR_TYPE IS REF CURSOR;
O_RESULT_SET CURSOR_TYPE;
IN_ORDER NUMBER := 476878;
BEGIN
WRONG_ORDER.GET_IDS(IN_ORDER,O_RESULT_SET);
end;
/
How can I see O_RESULT_SET,
everything I tryed as O_RESULT_SET%recordcount,
gives me error.

Thanks.
Re: how ro execute package in sql*plus [message #10861 is a reply to message #10857] Fri, 20 February 2004 08:59 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
The easiest would be to just call the get_ids proc directly instead of using the wrapper:

sql>var rc refcursor;
sql>var on number;
sql>exec :on := 476878; wrong_order.get_ids(:on, :rc);
sql>print rc
Previous Topic: Error while using function in where condition
Next Topic: How many columns have null values.
Goto Forum:
  


Current Time: Fri Apr 26 01:40:00 CDT 2024