Comments - CREATE PACKAGE BODY

5 years, 11 months ago Hamzeh Asefan

Could you please tell us how to call procedure or function in package?

 
5 years, 10 months ago Hamzeh Asefan

I got it :)

SET sql_mode=ORACLE; DELIMITER $$ CREATE OR REPLACE PACKAGE TEST_PKG AS FUNCTION getAnnualSal(eno INT) RETURN DECIMAL(10,2); PROCEDURE raiseSalary(eno INT, amount DECIMAL(10,2)); END TEST_PKG; $$

----------------------------------------------------------------------------------- SELECT TEST_PKG.getAnnualSal(7788); call TEST_PKG.raiseSalary(7788,10); -----------------------------------------------------------------------------------

 
5 years, 10 months ago Alexander Barkov

To call a package routine (procedure or function) from another routine of the same package, just use the routine name:

CALL p1(); SELECT f1();

To call public package routines outside of the package, use the package name as a qualifier:

CALL pgk1.p1(); SELECT pkg1.f1();

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.