ÈçÌâ ps£º¸ÃÖ÷¼ü²»ÊÇÐòÁУ¬Ö»ÊÇÆÕͨµÄ×ÔÔöÁÐSQL> set serveroutput on SQL> declare 2 v_id test.id%type; 3 begin 4 insert into test values(7,'ACÃ×À¼') returning id into v_id; 5 dbms_output.put_line(v_id); 6 end; 7 / 7
PL/SQL ¹ý³ÌÒѳɹ¦Íê³É¡£
SQL> INSERT INTO a VALUES (xxx, xxx) RETURNING ÁÐÃû INTO ±äÁ¿; up,DBA.
create or replace procedure getid(v_id out number) as v_sql varchar2(500);
begin
v_sql:='insert into test values(8,''tom'') returning id into ' || v_id; execute immediate v_sql; exception when others then &nb
ÓÃPL/SQL µÇ½ʱµ¯³ö±¨´í´°¿Ú£¬´íÎóÈçÏ£¡ ORA-01034:ORACLE not available ORA-27101:shared memory realm does not exist ÇëÎÊ£¬ÓÐûÓÐÈËÓöµ½ÕâÖÖÇé¿ö£¬Ôõô½â¾ö£¿Ð»Ð»£¡