复合变量--PL/SQL记录

复合类型:RECORD, TABLE, VARRAY

 

1.PL/SQL记录

---1.PL/SQL记录
DECLARE
  TYPE sysmta_record_type IS RECORD (
       v_syscd sysmta.syscd%TYPE,
       v_sysnm sysmta.sysnm%TYPE
   );---定义复合变量类型
   sysmta_record sysmta_record_type;--定义复合变量
BEGIN
   SELECT syscd, sysnm INTO sysmta_record
   FROM sysmta WHERE syscd=&tmp;
   
   DBMS_OUTPUT.PUT_LINE('SYSCD=' || sysmta_record.V_syscd || ', SYSNM=' || sysmta_record.V_SYSNM);
END;

 

输出结果:SYSCD=001, SYSNM=姅幃夛幮嶰榓

 

 

 

你可能感兴趣的:(sql)