How packaged procedures and functions are called from the following?

     a. Stored procedure or anonymous block     b. an application program such a PRC *C, PRO* COBOL     c. SQL *PLUS      a. PACKAGE NAME.PROCEDURE NAME (parameters);        variable := PACKAGE NAME.FUNCTION NAME (arguments);        EXEC SQL EXECUTE     b.          BEGIN               PACKAGE NAME.PROCEDURE NAME (parameters)               variable := PACKAGE NAME.FUNCTION NAME      (arguments);          END;          END EXEC;     c.  EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not have anyout/in-out parameters. A function can not be called.

Showing Answers 1 - 10 of 10 Answers

gigopi

  • Jul 19th, 2006
 

?Stored procedure or anonymous block

!packagename.procedurename(paramter...)

? Sql Plus Env

! Execute pack.procedure procedurename(params...)

Krish

  Was this answer useful?  Yes

idonknowyou

  • May 22nd, 2007
 

An anonymous block is not named, so it can never be called from outside functions or procedures or calling environment

A function residing in a package can also be called from a Calling environment, provided the it is a public function that is specified in the package specification

Syntax is EXECUTE :return_Variable := <Function_name> as part of SQL Expression

  Was this answer useful?  Yes

g_sidhu

  • Feb 16th, 2008
 

a. PACKAGE NAME.PROCEDURE NAME (parameters);

    variable := PACKAGE NAME.FUNCTION NAME (arguments);
        
b.
     BEGIN
     PACKAGE NAME.PROCEDURE NAME (parameters)
     variable := PACKAGE NAME.FUNCTION NAME(arguments);
     END;
     END EXEC;
c.  EXECUTE PACKAGE NAME.PROCEDURE
   VARIABLE g_salary NUMBER

  EXECUTE :g_salary := get_sal(117)


  Was this answer useful?  Yes

shi_fu

  • Nov 30th, 2010
 

a. procedure is called by its name:
pack_name.proc_name;
function is called from a expression:
a=b*(function(param));

b.(same as above)
procedure is called by its name:
pack_name.proc_name;
function is called from a expression:
a=b*(function(param));

c.procedure is called like:
execute proc_name; or exec proc_name;
we cannot call a funtion from sql*plus.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions