Oracle 复合变量之 RECORD

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> CREATE   OR   REPLACE
PROCEDURE    TEST_RECORD 
AS
  TYPE user_record_type 
IS  RECORD(
    id users.id
% TYPE,
    login_id users.login_id
% TYPE,
    name users.name
% TYPE);
  u_r_t user_record_type;
BEGIN
  
FOR  recd  IN  ( SELECT   *   FROM  users) LOOP
    
SELECT  id,login_id,name  INTO  u_r_t  FROM  users  WHERE  id = recd.id;
    dbms_output.put_line(
' ID:  ' || u_r_t.id  || ' ,    LOGIN_ID:  ' || u_r_t.login_id || ' ,    NAME:  ' || u_r_t.name);
  
END  LOOP;
  
NULL ;
END ;

你可能感兴趣的:(oracle)