Oracle 数组

DECLARE

  TYPE type_array IS VARRAY(6) OF VARCHAR2(10);

  var_dept type_array := type_array('0W',
                                    'QAS',
                                    'BFL',
                                    'HEL',
                                    'NL',
                                    '80CML');

BEGIN

  FOR i IN 1 .. var_dept.COUNT LOOP
    INSERT INTO TT_CONFIG T
      (T.ID,
       T.INT_CODE,
       T.INT_TYPE,
       T.CREATE_TM,
       T.CREATE_CODE,
       T.DS_CODE,
       T.CODE_NAME)
    VALUES
      (seq_base.nextval, 110, 2, SYSDATE, 'SYS', var_dept(i), 'xxxxx');
  END LOOP;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
    ROLLBACK;
END;

 

你可能感兴趣的:(oracle)