Toad [message #205877] |
Tue, 28 November 2006 00:27 |
lakshmi surya ram
Messages: 188 Registered: June 2006 Location: HYDERABAD
|
Senior Member |
|
|
Hi folks,
Where can I view the output of a procedure or function or cursor in Toad.I had executed the program in procedure editor.
Iam getting the error as
No create(or Replace )found to ececute
thanks,
surya
|
|
|
|
|
Re: Toad [message #206065 is a reply to message #205877] |
Tue, 28 November 2006 08:43 |
DiscoUser
Messages: 9 Registered: November 2006
|
Junior Member |
|
|
Create the procedure in Procedure Editor.
Example:
CREATE OR REPLACE PROCEDURE test123(x in number, y in number)
AS
XY number;
BEGIN
XY := x * y;
dbms_output.put_line(XY);
END test123;
Right Click on it and click on compile, or hit F9.
When no errors, Go to Schema Browser and locate your Procedure.
Right Click and select Execute.
You can also try writing a script in SQL editor window as
begin
test123(5,4);
end;
and execute it. Click on the DBMS Output Tab in the bottom half window to view the output.
Hope this helps.
DU.
|
|
|
|
|
Re: Toad [message #206366 is a reply to message #206149] |
Wed, 29 November 2006 14:25 |
DiscoUser
Messages: 9 Registered: November 2006
|
Junior Member |
|
|
Yes its the same for Functions and I guess for Cursors too(not very sure). For Cursors, you should be able to write any code in SQL Editor. Try this in SQL editor and see if you can see the output in DBMS Output tab. Replace TABLENAME with a valid table and COL1, COL2 with any 2 columns of that table.
declare
cursor cur is select * from TABLENAME;
rec TABLENAME%rowtype;
begin
open cur;
loop
fetch cur into rec;
exit when cur%notfound;
dbms_output.put_line('a: ' || rec.COL1 || ', b: ' || rec.COL2);
end loop;
end;
|
|
|
|