VastbaseE100

基于开源技术的HTAP数据库管理系统。性能优异,稳定可靠,提供诸多专属领域特性。

Menu

支持EXECUTE INTO USING 语句

DO $$ DECLARE
 v_sql VARCHAR2(60);
 v_jobno job.jobno%TYPE;
 v_jname job.jname%TYPE;
 r_job job%ROWTYPE;
BEGIN
 DBMS_OUTPUT.PUT_LINE('JOBNO JNAME');
 DBMS_OUTPUT.PUT_LINE('----- -------');
 v_sql := 'SELECT jobno, jname FROM job WHERE jobno = :p_jobno';
 EXECUTE  v_sql INTO v_jobno, v_jname USING 100;
 DBMS_OUTPUT.PUT_LINE(v_jobno || ' ' || v_jname);
 EXECUTE  v_sql INTO v_jobno, v_jname USING 200;
 DBMS_OUTPUT.PUT_LINE(v_jobno || ' ' || v_jname);
 EXECUTE  v_sql INTO v_jobno, v_jname USING 300;
 DBMS_OUTPUT.PUT_LINE(v_jobno || ' ' || v_jname);
 EXECUTE  v_sql INTO v_jobno, v_jname USING 400;
 DBMS_OUTPUT.PUT_LINE(v_jobno || ' ' || v_jname);
 EXECUTE  v_sql INTO r_job USING 500;
 DBMS_OUTPUT.PUT_LINE(r_job.jobno || ' ' || r_job.jname);
END $$;
NOTICE:  JOBNO JNAME
NOTICE:  ----- -------
NOTICE:  100 ANALYST
NOTICE:  200 CLERK
NOTICE:  300 MANAGER
NOTICE:  400 SALESMAN
NOTICE:  500 PRESIDENT