SET serveroutput ON;
DECLARE
PROCEDURE get_csa_type(pin_CVC_object_id IN NUMBER
,posa_csa_type OUT common.types.string
,pona_permanent_csa OUT common.types.string
)
IS
lc_csa_type common.types.string := 'SELECT UNIQUE csa.csa_type,csa.permanent_csa '||
'FROM ems.ibo_sm_cvc_rfs cvc' ||
',ems.ibo_nbn_csa csa ' ||
'WHERE cvc.object_id = :1 ' ||
'AND csa.csa_id = cvc.csa_id';
BEGIN
EXECUTE IMMEDIATE lc_csa_type BULK COLLECT INTO posa_csa_type, pona_permanent_csa
USING pin_CVC_object_id;
END;
ls_csa_type common.types.string;
ls_permanent_csa common.types.string;
BEGIN
get_csa_type(pin_CVC_object_id => 8581213
,posa_csa_type => ls_csa_type
,pona_permanent_csa => ls_permanent_csa);
dbms_output.put_line(ls_csa_type || ls_permanent_csa);
END;
我可以聲明並在pl-sql塊中調用上面的過程。當我嘗試運行此我得到幾個錯誤...聲明並在PL-SQL塊中使用PROCEDURE
Encountered the symbol "LS_CSA_TYPE" when expecting one of the following:
begin function pragma procedure
Encountered the symbol "DBMS_OUTPUT" when expecting one of the following:
:= . (% ;
是的,你可以。請開始來自[PL/SQL概述](http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/overview.htm#LNPLS141)。它解釋了一個語法錯誤。 – user272735
謝謝,但我在這裏找不到聲明過程並在塊中執行它 –