如何在包中建立数据库链接,在线等待。
我建立了一个package
在里面建立数据库链接。结果提示错误
pls-00103
代码如下:
PACKAGE BODY "READ_INTERFACE_PACKAGE" AS
CURSOR Revert_112_Cursor RETURN REVERT_112_TABLE%ROWTYPE IS
SELECT * FROM REVERT_112_TABLE;
CURSOR Ask_112_Cursor RETURN ASK_112_TABLE%ROWTYPE IS
SELECT * FROM ASK_112_TABLE;
-- Achieve the proc of ask_maten_operate
-- get 112 ask info,and insert it to our databases
PROCEDURE ask_maten_operate IS
BEGIN
INSERT INTO TEMP_TABLE VALUES('1','2');
END ask_maten_operate;
-- Achieve the proc of revert_maten_operate
-- this proc is used for opertate the obstale that rejected and reverted by 112.
PROCEDURE revert_maten_operate IS
BEGIN
INSERT INTO TEMP_TABLE VALUES('1','2');
END revert_maten_operate;
-- Achieve the proc of connect_database_link
-- this proc is used for create database link of interface database.
PROCEDURE create_database_link IS
BEGIN
———————————————————————————————————
/* -- create datbase link for interface database --*/
create database link DB_INTERFACE connect to BENZ identified by
BENZ using 'TIGER_74';
——————————————————————————————————
END create_database_link;
-- Achieve the function of get_dept_id
-- this proc is used for get dept_id
FUNCTION get_dept_id(system_flag NUMBER,trepair_code NUMBER)
RETURN VARCHAR IS
BearingDept VARCHAR(10);
BEGIN
RETURN BearingDept;
END;
-- Achieve the function of get_dept_id
-- this proc is used for get comp_id
FUNCTION get_comp_id(system_flag NUMBER,sub_num VARCHAR2)
RETURN VARCHAR IS
BearingComp VARCHAR(10);
BEGIN
RETURN BearingComp;
END;
END read_interface_package;