Home » SQL & PL/SQL » SQL & PL/SQL » Help with user-defined function
Help with user-defined function [message #8161] Wed, 30 July 2003 19:27 Go to next message
Nazma Bepat
Messages: 34
Registered: May 2003
Member
I have just created a PL/SQL user-defined function called Calc_Grade and is trying to figure out which of the 4 statement will successfully test it
EXECUTE calc_grade;
EXECUTE calc_grade(SELECT grade FROM grade_book);
SELECT * FROM calc_grade(grade);
SELECT calc_grade(grade) FROM grade_book;
Can someone please help me out.

Thanks
Re: Help with user-defined function [message #8168 is a reply to message #8161] Thu, 31 July 2003 00:14 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Try the fourth.

The first two will fail (this is a function, it returns something while EXECUTE is for Procedures). You could wrap it in a call to dbms_output.put_line, which results in the following (don't forget to set the serveroutput on):
EXECUTE <B>Dbms_Output.Put_Line(</B>calc_grade(parameter?)<B>)</B>


The third won't work either.

MHE
Previous Topic: recreate a procedure
Next Topic: Search for AlphaNumeric Characters in a column value
Goto Forum:
  


Current Time: Fri Apr 26 08:02:36 CDT 2024