CREATE OR REPLACE PROCEDURE test_in_out_exception (v_empno VARCHAR2,v_guess_sal NUMBER,v_true_sal OUT NUMBER) AS v_exits ); v_sal emp.sal%TYPE; v_raise EXCEPTION; BEGIN ) INTO v_exits FROM emp t WHERE t.empno = v_empno; ) THEN SELECT t.sal INTO v_sal…
前几天编写一个存储过程,需要访问远程数据库的字段,于是建立一个dbLink并建了同义词: CREATE PUBLIC DATABASE LINK orcl@dbc CONNECT TO orcl IDENTIFIED BY orcl USING 'orcl'; CREATE SYNONYM mtb FOR mytable@orcl@dbc: 这里之所以用orcl@bdc为dblink的名称是为了设置global_names=true. 然后新建一个存储过程调用该同义词: v_result mtb…
package com.jckb.procedure; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; public class MainTest { /** * 存储过程plsql create or replace procedure findEmpInfo(pno in number,pname out varchar2,psal out number…
1.nest表组合成结果集,然后以游标变量的形式返回 --创建类型 create or replace package mytest is -- Author : ADMINISTRATOR -- Created : 2008-5-13 11:19:28 -- Purpose : test TYPE record_type IS RECORD( code VARCHAR2(18), p_name VARCHAR2(16)); TYPE ref_cur_type IS…