调用包里面的变量、常量、函数、方法等需要在对象名里包含包的名字,并用“.”分隔。
示例:调用包的函数和方法
obclient> call pkg_test.sp_insert_t1('ABC');
Query OK, 0 rows affected (0.32 sec)
obclient> call pkg_test.sp_insert_t1('DEF');
Query OK, 0 rows affected (0.01 sec)
obclient> SELECT pkg_test.f_maxid_of_t1() FROM DUAL;
+--------------------------+
| PKG_TEST.F_MAXID_OF_T1() |
+--------------------------+
| 10007 |
+--------------------------+
1 row in set (0.01 sec)
obclient> select * from t1;
+-------+------+---------------------+
| ID | NAME | GMT_CREATE |
+-------+------+---------------------+
| 10006 | ABC | 2020-04-02 19:03:30 |
| 10007 | DEF | 2020-04-02 19:03:35 |
+-------+------+---------------------+
2 rows in set (0.00 sec)