All Products
Search
Document Center

PolarDB:Use a package

Last Updated:Mar 28, 2026

Use dot notation to reference types, items, and subprograms declared in a package specification:

package_name.type_name
package_name.item_name
package_name.subprogram_name

Call a function from a package

Run the following SQL command to call the get_dept_name function from the emp_admin package specification, passing the department number as an argument:

SELECT emp_admin.get_dept_name(10) FROM DUAL;

The function returns the name of the department that corresponds to the given number. For department 10, the return value is ACCOUNTING:

 get_dept_name
---------------
 ACCOUNTING
(1 row)