<?xml version='1.0' encoding='UTF-8'?>
<ROWSET tableName='GF07'>
/****************************************************************************/
/* GF07 ( ｲﾝﾃﾞｯｸｽｶﾗﾑ定義 )                                                  */
/*                                                                          */
/* Created : 2022/11/10 17:41:42                                            */
/****************************************************************************/
<EXEC_SQL exists="0">
SELECT COUNT(*) FROM RDB$RELATIONS WHERE RDB$SYSTEM_FLAG=0 and RDB$RELATION_TYPE=0 and RDB$RELATION_NAME=UPPER('GF07');
CREATE TABLE GF07 (
   SYSTEM_ID    VARCHAR ( 10 )                  NOT NULL                
 , TBLSYU       VARCHAR (  1 )                  NOT NULL                
 , TABLE_NAME   VARCHAR ( 50 )                  NOT NULL                
 , INDEX_NAME   VARCHAR ( 30 )                  NOT NULL                
 , CLM          VARCHAR ( 50 )                  NOT NULL                
 , SEQNO        INTEGER             DEFAULT 0   NOT NULL                
 , UNIQ         BIGINT                          NOT NULL                
 , FGJ          VARCHAR (  1 )      DEFAULT '1' NOT NULL                
 , DYSET        VARCHAR ( 14 )                                          
 , PGSET        VARCHAR ( 50 )                                          
 , PGPSET       VARCHAR ( 50 )                                          
 , USRSET       VARCHAR ( 30 )                                          
 , DYUPD        VARCHAR ( 14 )                                          
 , PGUPD        VARCHAR ( 50 )                                          
 , PGPUPD       VARCHAR ( 50 )                                          
 , USRUPD       VARCHAR ( 30 )                                          
);
</EXEC_SQL>

<EXEC_SQL exists="0">
SELECT COUNT(*) FROM RDB$GENERATORS WHERE RDB$GENERATOR_NAME=UPPER('GF07S00');
CREATE SEQUENCE GF07S00 ;
</EXEC_SQL>

<EXEC_SQL>
CREATE TRIGGER GF07T00 FOR GF07
  BEFORE INSERT AS 
  BEGIN 
    NEW.UNIQ = GEN_ID( GF07S00,1 );
  END; 
</EXEC_SQL>
</ROWSET>
