Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute a pacakge from SQL PLus

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
I have a few packages in my oracle database, I want to be able to execute the package from SQL plus and pass in parameters so I can get a result set back.

ie.

myPackagename.GetallRecords
input datetime = '1 Feb 2006'
output = refcursor

I know this may be a newbie question but I cannot seem to find this in the books online.

Thanks in Advance.
G

George Oakes
Check out this awsome .Net Resource!
 
Well I found out how, took me some digging through the web and finaly found a way.

Some of the resources say you can use the execute statement to do this but when i tried I kept getting an invalid SQL statement error, but when I used the following method of Begin <Statement> End I got it to work.

Here is the code I used with the input parameters that worked for me...

Code:
BEGIN
GUARANTEEDDRAW.INSERTGDPROGRAM (10,89024, '1 Feb 2006', '28 Feb 2007', 39, 'G', 230.77, 0, '');
END;

Thanks in advance

George Oakes
Check out this awsome .Net Resource!
 
All the execute statement does is wrap the call in a begin and end. You could have run the procedure using.


EXEC GUARANTEEDDRAW.INSERTGDPROGRAM (10,89024, '1 Feb 2006', '28 Feb 2007', 39, 'G', 230.77, 0, '');


Bill
Oracle DBA/Developer
New York State, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top