[Recent File List]
File1=SAMPLE.OBG
File2=SYBASE.OBG
File3=ORACLE.OBG
File4=

[DDL]
ServerType=ODBC
FileName=CLARITY.DDL

[SUBSTITUTE]
ENTRIES_NUM=3
ENTRIES_1=[-][_]
ENTRIES_2=[ ][_]
ENTRIES_2=[/][_]

[DATAWINDOWS]
CROSSREFFILE=DATAWND.XRF
DATAWINDOWPREFIX=DW_
USEROBJECTPREFIX=UO_
WINDOWPREFIX=W_

[LOGIN]
SERVER=Powersoft Demo DB
DATABASE=
USER=dba
PASSWORD=sql

[ODBC-TRANSACTIONS]
GETEDITMASKS_1=select pbe_name, pbe_edit, pbe_type, pbe_cntr, pbe_seqn, pbe_flag, pbe_work from pbcatedt order by pbe_name, pbe_seqn
GETFORMATMASKS_1=select pbf_name, pbf_frmt, pbf_type, pbf_cntr from pbcatfmt order by pbf_name
GETVALIDMASKS_1=select pbv_name, pbv_vald, pbv_type, pbv_cntr, pbv_msg from pbcatvld order by pbv_name
GETEXTATTRIBUTES_1=select pbc_cmnt, pbc_edit, pbc_mask, pbc_hdr, pbc_hght, pbc_init, pbc_jtfy, pbc_labl, pbc_ptrn, pbc_wdth, pbc_bmap from pbcatcol where pbc_ownr = '&OWNERNAME&' and pbc_tnam = '&TABLENAME&' and pbc_cnam = '&COLUMNNAME&'
GETTABLES_1=NOT APPLICABLE
GETCOLUMNS_1=NOT APPLICABLE
GETPKEYS_1=NOT APPLICABLE
GETFKEYS_1=NOT APPLICABLE
GETINDEXES_1=NOT APPLICABLE
GETVALIDMASKS_NUM=1
GETFORMATMASKS_NUM=1
GETEDITMASKS_NUM=1
GETEXTATTRIBUTES_NUM=1
GETTABLES_NUM=1
GETCOLUMNS_NUM=1
GETPKEYS_NUM=1
GETFKEYS_NUM=1
GETINDEXES_NUM=1
ReadProcedures_1=
ReadProcedures_NUM=1

[ODBC-DDL]
SendTransaction_1=GO
CreateTable_1=CREATE TABLE &OWNERNAME.&&TABLENAME& &END&(&CREATECOLUMNS&) &END&&SENDTRANSACTION&&END&
CreatePrimaryKey_1=ALTER TABLE &OWNERNAME.&&TABLENAME& ADD PRIMARY KEY (&PKCOLUMNLIST&) &END&&SENDTRANSACTION&&END&
CreateForeignKey_1=ALTER TABLE &FCHILDOWNERNAME.&&FCHILDTABLENAME& ADD FOREIGN KEY &FRELANAME& (&FPARENTCOLUMNLIST&) REFERENCES &FPARENTOWNERNAME.&&FPARENTTABLENAME& &END&&SENDTRANSACTION&&END&
CreateIndex_1=CREATE &UNIQUE& INDEX &INDEXNAME& ON &OWNERNAME.&&TABLENAME& (&INDEXCOLUMNLIST&) &END&&SENDTRANSACTION&&END&
CreateTableComment_1=comment on table &OWNERNAME.&&TABLENAME& as "&TABLEREMARK&" &END&&SENDTRANSACTION&&END&
CreateColumnComment_1=comment on column &TABLENAME.&&COLUMNNAME& as "&COLUMNREMARK&" &END&&SENDTRANSACTION&&END&
CreateExtAttributes_1=insert into system.pbcatcol(pbc_cmnt,pbc_edit,pbc_mask,pbc_hdr,pbc_hght,pbc_init,pbc_jtfy,pbc_labl,pbc_ptrn,pbc_wdth,pbc_bmap)
CreateExtAttributes_2=values('&PBC_CMNT&','&PBC_EDIT&','&PBC_MASK&','&PBC_HDR&',&PBC_HGHT&,'&PBC_INIT&',&PBC_JTFY&,'&PBC_LABL&','&PBC_PTRN&',&PBC_WDTH&,'&PBC_BMAP&') 
CreateExtAttributes_3=where pbc_ownr = '&OWNERNAME&' and pbc_tnam='&TABLENAME&' and pbc_cnam = '&COLUMNNAME&'&END&&SENDTRANSACTION&&END&
CreateProcedures_1=&PROCEDUREBODY&&END&&SENDTRANSACTION&&END&
Sort_Ascending=
Sort_Descending=D
col_null=NULL
col_notnull=NOT NULL
SendTransaction_NUM=1
CreateTable_NUM=1
CreatePrimaryKey_NUM=1
CreateForeignKey_NUM=1
CreateIndex_NUM=1
CREATEEXTATTRIBUTES_NUM=3
CreateTableComment_NUM=1
CreateColumnComment_NUM=1
CreateProcedures_NUM=1

[SYBASE-TRANSACTIONS]
GETEDITMASKS_1=select pbe_name, pbe_edit, pbe_type, pbe_cntr, pbe_seqn, pbe_flag, pbe_work from pbcatedt order by pbe_name, pbe_seqn
GETFORMATMASKS_1=select pbf_name, pbf_frmt, pbf_type, pbf_cntr from pbcatfmt order by pbf_name
GETVALIDMASKS_1=select pbv_name, pbv_vald, pbv_type, pbv_cntr, pbv_msg from pbcatvld order by pbv_name
GETEXTATTRIBUTES_1=select pbc_cmnt, pbc_edit, pbc_mask, pbc_hdr, pbc_hght, pbc_init, pbc_jtfy, pbc_labl, pbc_ptrn, pbc_wdth, pbc_bmap from pbcatcol where pbc_ownr = '&OWNERNAME&' and pbc_tnam = '&TABLENAME&' and pbc_cnam = '&COLUMNNAME&'
GETTABLES_1=sp_tables @table_type = "'TABLE'"
GETCOLUMNS_1=sp_columns '&TABLENAME&'
GETPKEYS_1=sp_pkeys '&TABLENAME&'
GETFKEYS_1=sp_fkeys NULL, NULL, NULL, '&TABLENAME&'
GETINDEXES_1=sp_statistics '&TABLENAME&'
GETTYPES_1=select a.name, b.name from systypes a, systypes b where a.usertype > 100 and a.type = b.type and b.usertype < 100
ReadProcedures_1=select a.name, b.text
ReadProcedures_2=from sysobjects a, syscomments b
ReadProcedures_3=where a.type = 'P' and b.id = a.id
ReadProcedures_NUM=3
GETVALIDMASKS_NUM=1
GETFORMATMASKS_NUM=1
GETEDITMASKS_NUM=1
GETEXTATTRIBUTES_NUM=1
GETTABLES_NUM=1
GETCOLUMNS_NUM=1
GETPKEYS_NUM=1
GETFKEYS_NUM=1
GETINDEXES_NUM=1

[SYBASE-DDL]
SendTransaction_1=GO
CreateTable_1=CREATE TABLE &TABLENAME& &END&(&CREATECOLUMNS&) &END&&SENDTRANSACTION&&END&
CreatePrimaryKey_1=sp_primarykey &TABLENAME&, &PKCOLUMNLIST& &END&&SENDTRANSACTION& &END&
CreateForeignKey_1=sp_primarykey &FCHILDTABLENAME&, &FPARENTTABLENAME&, &FPARENTCOLUMNLIST& &END&&SENDTRANSACTION&&END&
CreateIndex_1=CREATE &UNIQUE& &CLUSTERED& INDEX &INDEXNAME& ON &TABLENAME& (&INDEXCOLUMNLIST&) &END&&SENDTRANSACTION&&END&
CreateExtAttributes_1=insert into system.pbcatcol(pbc_cmnt,pbc_edit,pbc_mask,pbc_hdr,pbc_hght,pbc_init,pbc_jtfy,pbc_labl,pbc_ptrn,pbc_wdth,pbc_bmap)
CreateExtAttributes_2=values('&PBC_CMNT&','&PBC_EDIT&','&PBC_MASK&','&PBC_HDR&',&PBC_HGHT&,'&PBC_INIT&',&PBC_JTFY&,'&PBC_LABL&','&PBC_PTRN&',&PBC_WDTH&,'&PBC_BMAP&') 
CreateExtAttributes_3=where pbc_ownr = '&OWNERNAME&' and pbc_tnam='&TABLENAME&' and pbc_cnam = '&COLUMNNAME&'&END&&SENDTRANSACTION&&END&
CreateProcedures_1=&FREEFORMBODY&&END&&SENDTRANSACTION&&END&
Sort_Ascending=ASC
Sort_Descending=
col_null=NULL
col_notnull=
CREATEEXTATTRIBUTES_NUM=3
SendTransaction_NUM=1
CreateTable_NUM=1
CreatePrimaryKey_NUM=1
CreateForeignKey_NUM=1
CreateIndex_NUM=1
CreateTableComment_1=
CreateTableComment_NUM=1
CreateColumnComment_1=
CreateColumnComment_NUM=1
CreateProcedures_NUM=1

[SYBASE-TRIGGERS]  
ENTRIES_NUM=11
ENTRIES_1 =INSERTTRIGGER
ENTRIES_2 =INSERT-PARENTEXIST
ENTRIES_3 =UPDATETRIGGER
ENTRIES_4 =UPDATE-PARENTEXIST
ENTRIES_5 =UPDATE-PARENTCHANGE
ENTRIES_6 =UPDATE-RESTRICT
ENTRIES_7 =UPDATE-CASCADE
ENTRIES_8 =DELETETRIGGER
ENTRIES_9 =DELETE-RESTRICT
ENTRIES_10=DELETE-CASCADE  
ENTRIES_11=DELETE-SETNULL      
INSERTTRIGGER_NUM=13
INSERT-PARENTEXIST_NUM=11
INSERTTRIGGER_1=/* INSERT TRIGGER FOR &TABLENAME& */
INSERTTRIGGER_2=create trigger ti_&TABLENAME& on &TABLENAME& for insert as
INSERTTRIGGER_3=begin
INSERTTRIGGER_4=declare @numrows int
INSERTTRIGGER_5=select @numrows = @@rowcount
INSERTTRIGGER_6=
INSERTTRIGGER_7=if @numrows = 0
INSERTTRIGGER_8=return
INSERTTRIGGER_9=
INSERTTRIGGER_10=~LOOP_PARENT("MANDATORY_PARENT", "INSERT-PARENTEXIST")~
INSERTTRIGGER_11=
INSERTTRIGGER_12=return
INSERTTRIGGER_13=end&END&&SENDTRANSACTION&&END&
INSERT-PARENTEXIST_1=/* Value must exist in parent "&FPARENTTABLENAME&" when inserting into "&FCHILDTABLENAME&" */
INSERT-PARENTEXIST_2=if ~CONCAT("update (&CHILDCOLUMN&)", "", " or", "")~
INSERT-PARENTEXIST_3=begin
INSERT-PARENTEXIST_4=if (select count(*)
INSERT-PARENTEXIST_5=from  &FPARENTTABLENAME& a, inserted b
INSERT-PARENTEXIST_6=where ~CONCAT("a.&PARENTCOLUMN& = b.&CHILDCOLUMN&", "and   ", "", ") != @numrows")~
INSERT-PARENTEXIST_7=begin
INSERT-PARENTEXIST_8=raiserror 20001 'Can not insert into "&FCHILDTABLENAME&" unless value exists in "&FPARENTTABLENAME&"'
INSERT-PARENTEXIST_9=rollback transaction
UPDATETRIGGER_1=/* UPDATE TRIGGER FOR &TABLENAME& */
UPDATETRIGGER_2=create trigger tu_&TABLENAME& on &TABLENAME& for update as
UPDATETRIGGER_3=begin
UPDATETRIGGER_NUM=16
UPDATE-PARENTEXIST_1=/* Value must exist in parent "&FPARENTTABLENAME&" when updating "&FCHILDTABLENAME&" */
UPDATE-PARENTEXIST_2=IF ~CONCAT("update (&CHILDCOLUMN&)", "", " or", "")~
UPDATE-PARENTEXIST_3=begin
UPDATE-PARENTEXIST_NUM=11
UPDATETRIGGER_4=declare @numrows int
UPDATETRIGGER_5=select @numrows = @@rowcount
UPDATETRIGGER_6=
UPDATETRIGGER_7=if @numrows = 0
UPDATETRIGGER_8=return
UPDATETRIGGER_9=
UPDATETRIGGER_10=~LOOP_PARENT("MANDATORY_PARENT", "UPDATE-PARENTEXIST")~
UPDATETRIGGER_11=~LOOP_PARENT("CHANGE_PARENT", "UPDATE-PARENTCHANGE")~
UPDATETRIGGER_12=~LOOP_CHILD("UPDATE_RESTRICT", "UPDATE-RESTRICT")~
UPDATETRIGGER_13=~LOOP_CHILD("UPDATE_CASCADE", "UPDATE-CASCADE")~
UPDATETRIGGER_14=
UPDATETRIGGER_15=return
UPDATETRIGGER_16=end&END&&SENDTRANSACTION&&END&
UPDATE-PARENTEXIST_4=if (select count(*)
UPDATE-PARENTEXIST_5=from  &FPARENTTABLENAME& a, inserted b
UPDATE-PARENTEXIST_6=where ~CONCAT("a.&PARENTCOLUMN& = b.&CHILDCOLUMN&", "and   ", "", ") != @numrows")~
UPDATE-PARENTEXIST_7=begin
UPDATE-PARENTEXIST_8=raiserror 20003 'Can not update "&FCHILDTABLENAME&" unless value exists in "&FPARENTTABLENAME&"'
UPDATE-PARENTEXIST_9=rollback transaction
UPDATE-PARENTCHANGE_1=/* Cant modify the foreign key fields to "&FPARENTTABLENAME&" when updating "&FCHILDTABLENAME&" */
UPDATE-PARENTCHANGE_2=IF ~CONCAT("update (&CHILDCOLUMN&)", "", " or", "")~
UPDATE-PARENTCHANGE_3=begin
UPDATE-PARENTCHANGE_4=if (exists (select 1
UPDATE-PARENTCHANGE_5=from  inserted a, deleted b
UPDATE-PARENTCHANGE_6=where ~CONCAT("a.&PARENTCOLUMN& = b.&PARENTCOLUMN&", "", "or   ", ")")~
UPDATE-PARENTCHANGE_7=begin
UPDATE-PARENTCHANGE_8=raiserror 20004 ' Cant modify the foreign key fields to "&FPARENTTABLENAME&" when updating "&FCHILDTABLENAME&"'
UPDATE-PARENTCHANGE_9=rollback transaction
UPDATE-PARENTCHANGE_NUM=11
UPDATE-RESTRICT_1=/* Cant update primary key in "&FPARENTTABLENAME&" if children still exist in "&FCHILDTABLENAME&" */
UPDATE-RESTRICT_2=if ~CONCAT("update (&PARENTCOLUMN&)", "" , " or", "")~
UPDATE-RESTRICT_3=begin
UPDATE-RESTRICT_4=if exists (select 1
UPDATE-RESTRICT_NUM=12
UPDATE-CASCADE_1=/* Cascade new primary key for  "&FPARENTTABLENAME&" to all children  in "&FCHILDTABLENAME&" */
UPDATE-CASCADE_2=if ~CONCAT("update (&PARENTCOLUMN&)", "" , " or", "")~
UPDATE-CASCADE_NUM=9
UPDATE-CASCADE_3=begin
UPDATE-CASCADE_4=update &FCHILDTABLENAME&
UPDATE-CASCADE_5=set ~CONCAT("&CHILDCOLUMN&  = b.&PARENTCOLUMN&", "", ",", "")~
UPDATE-CASCADE_6=from &FCHILDTABLENAME& a, inserted b, deleted c
UPDATE-CASCADE_7=where ~CONCAT("a.&CHILDCOLUMN&  = c.&PARENTCOLUMN&", "and   ", "", "")~
UPDATE-CASCADE_8=and (~CONCAT("b.&PARENTCOLUMN& != c.&PARENTCOLUMN&", "", " or", ")")~
UPDATE-CASCADE_9=end
UPDATE-RESTRICT_5=from &FCHILDTABLENAME& a, inserted b, deleted c
UPDATE-RESTRICT_6=where ~CONCAT("a.&CHILDCOLUMN&  = c.&PARENTCOLUMN&", "and   ", "", "")~
UPDATE-RESTRICT_7=and (~CONCAT("b.&PARENTCOLUMN& != c.&PARENTCOLUMN&", "or   ", "", "))")~
UPDATE-RESTRICT_8=begin
UPDATE-RESTRICT_9=raiserror 20005 'Cant update primary key in "&FPARENTTABLENAME&" if children still exist in "&FCHILDTABLENAME&"'
UPDATE-RESTRICT_10=rollback transaction
UPDATE-RESTRICT_11=end
UPDATE-RESTRICT_12=end&END&
UPDATE-PARENTCHANGE_10=end
UPDATE-PARENTCHANGE_11=end&END&
UPDATE-PARENTEXIST_10=end
UPDATE-PARENTEXIST_11=end&END&
INSERT-PARENTEXIST_10=end
INSERT-PARENTEXIST_11=end&END&
DELETETRIGGER_1=/* DELETE TRIGGER FOR &TABLENAME& */
DELETETRIGGER_2=create trigger td_&TABLENAME& on &TABLENAME& for delete as
DELETETRIGGER_3=begin
DELETETRIGGER_4=declare @numrows int
DELETETRIGGER_5=select @numrows = @@rowcount
DELETETRIGGER_6=
DELETETRIGGER_7=if @numrows = 0
DELETETRIGGER_8=return
DELETETRIGGER_9=
DELETETRIGGER_10=~LOOP_CHILD("DELETE_RESTRICT", "DELETE-RESTRICT")~
DELETETRIGGER_11=~LOOP_CHILD("DELETE_CASCADE", "DELETE-CASCADE")~
DELETETRIGGER_12=~LOOP_CHILD("DELETE_NULL", "DELETE-SETNULL")~
DELETETRIGGER_13=
DELETETRIGGER_14=return
DELETETRIGGER_15=end&END&&SENDTRANSACTION&&END&
DELETETRIGGER_NUM=15
DELETE-CASCADE_1=/* CASCADE the DELETE of all children  in "&FCHILDTABLENAME&" */
DELETE-CASCADE_2=delete &FCHILDTABLENAME&
DELETE-CASCADE_3=from &FCHILDTABLENAME& a, deleted b
DELETE-CASCADE_4=where ~CONCAT("a.&CHILDCOLUMN&  = b.&PARENTCOLUMN&", "and   ", "", "")~
DELETE-CASCADE_NUM=4
DELETE-SETNULL_1=/* Set foreign key to "&FPARENTTABLENAME&" in "&FCHILDTABLENAME&"  to NULL*/
DELETE-SETNULL_2=update &FCHILDTABLENAME&
DELETE-SETNULL_3=set ~CONCAT("&CHILDCOLUMN&  = NULL", "", ",", "")~
DELETE-SETNULL_4=from &FCHILDTABLENAME& a, deleted b
DELETE-SETNULL_5=where ~CONCAT("a.&CHILDCOLUMN&  = b.&PARENTCOLUMN&", "and   ", "", "")~
DELETE-SETNULL_NUM=5
DELETE-RESTRICT_1=/* Cant remove data from "&FPARENTTABLENAME&" if children still exist in "&FCHILDTABLENAME&" */
DELETE-RESTRICT_2=if exists (select 1
DELETE-RESTRICT_3=from &FCHILDTABLENAME& a, inserted b, deleted c
DELETE-RESTRICT_4=where ~CONCAT("a.&CHILDCOLUMN&  = c.&PARENTCOLUMN&", "and   ", "", "")~
DELETE-RESTRICT_5=and (~CONCAT("b.&PARENTCOLUMN& != c.&PARENTCOLUMN&", "or   ", "", "))")~
DELETE-RESTRICT_6=begin
DELETE-RESTRICT_7=raiserror 20005 'Cant remove data from "&FPARENTTABLENAME&" if children still exist in "&FCHILDTABLENAME&"'
DELETE-RESTRICT_8=rollback transaction
DELETE-RESTRICT_9=end
DELETE-RESTRICT_10=end&END&
DELETE-RESTRICT_11=end
DELETE-RESTRICT_12=end&END&
DELETE-RESTRICT_NUM=10

[ORACLE-DDL]
SendTransaction_1=GO
CreateTable_1=CREATE TABLE &OWNERNAME.&&TABLENAME& &END&(&CREATECOLUMNS&) &END&&SENDTRANSACTION&&END&
CreatePrimaryKey_1=ALTER TABLE &OWNERNAME.&&TABLENAME& ADD CONSTRAINT &PKNAME& PRIMARY KEY (&PKCOLUMNLIST&) &END&&SENDTRANSACTION&&END&
CreateForeignKey_1=ALTER TABLE &FCHILDOWNERNAME.&&FCHILDTABLENAME& ADD CONSTRAINT &FRELANAME& FOREIGN KEY (&FCHILDCOLUMNLIST&) REFERENCES &FPARENTOWNERNAME.&&FPARENTTABLENAME&(&FPARENTCOLUMNLIST&) &END&&SENDTRANSACTION&&END&
CreateIndex_1=CREATE &UNIQUE& INDEX &INDEXNAME& ON &OWNERNAME.&&TABLENAME& (&INDEXCOLUMNLIST&) &END&&SENDTRANSACTION&&END&
CreateTableComment_1=comment on table &OWNERNAME.&&TABLENAME& is '&TABLEREMARK&' &END&&SENDTRANSACTION&&END&
CreateColumnComment_1=comment on column &TABLENAME.&&COLUMNNAME& is '&COLUMNREMARK&' &END&&SENDTRANSACTION&&END&
CreateExtAttributes_1=insert into system.pbcatcol(pbc_cmnt,pbc_edit,pbc_mask,pbc_hdr,pbc_hght,pbc_init,pbc_jtfy,pbc_labl,pbc_ptrn,pbc_wdth,pbc_bmap)
CreateExtAttributes_2=values('&PBC_CMNT&','&PBC_EDIT&','&PBC_MASK&','&PBC_HDR&',&PBC_HGHT&,'&PBC_INIT&',&PBC_JTFY&,'&PBC_LABL&','&PBC_PTRN&',&PBC_WDTH&,'&PBC_BMAP&') 
CreateExtAttributes_3=where pbc_ownr = '&OWNERNAME&' and pbc_tnam='&TABLENAME&' and pbc_cnam = '&COLUMNNAME&'&END&&SENDTRANSACTION&&END&
CreateProcedures_1=&PROCEDUREBODY&&END&&SENDTRANSACTION&&END&
Sort_Ascending=
Sort_Descending=
col_null=NULL
col_notnull=CONSTRAINT NN_&COLUMNNAME& NOT NULL
CREATEEXTATTRIBUTES_NUM=3
SendTransaction_NUM=1
CreateTable_NUM=1
CreatePrimaryKey_NUM=1
CreateForeignKey_NUM=1
CreateIndex_NUM=1
CreateTableComment_NUM=1
CreateColumnComment_NUM=1

[ORACLE-TRANSACTIONS]
GETEDITMASKS_1=select pbe_name, pbe_edit, pbe_type, pbe_cntr, pbe_seqn, pbe_flag, pbe_work from system.pbcatedt order by pbe_name, pbe_seqn
GETFORMATMASKS_1=select pbf_name, pbf_frmt, pbf_type, pbf_cntr from system.pbcatfmt order by pbf_name
GETVALIDMASKS_1=select pbv_name, pbv_vald, pbv_type, pbv_cntr, pbv_msg from system.pbcatvld order by pbv_name
GETEXTATTRIBUTES_1=select pbc_cmnt, pbc_edit, pbc_mask, pbc_hdr, pbc_hght, pbc_init, pbc_jtfy, pbc_labl, pbc_ptrn, pbc_wdth, pbc_bmap from system.pbcatcol where pbc_ownr = '&OWNERNAME&' and pbc_tnam = '&TABLENAME&' and pbc_cnam = '&COLUMNNAME&'
GETTABLES_1=select a.tablespace_name, a.owner, a.table_name, b.comments
GETCOLUMNS_1=select a.column_name, a.data_type, a.data_precision, a.data_length, a.data_scale, a.nullable, b.comments from all_tab_columns a, all_col_comments b
GETCOLUMNS_2=where b.owner = a.owner and b.table_name = a.table_name and b.column_name = a.column_name and a.owner = '&OWNERNAME&' and a.table_name = '&TABLENAME&'
GETPKEYS_1=select a.constraint_name, b.column_name, position
GETPKEYS_2=from all_constraints a, all_cons_columns b
GETPKEYS_3=where a.owner = '&OWNERNAME&' 
GETPKEYS_4=and a.table_name = '&TABLENAME&'
GETPKEYS_5=and a.constraint_type = 'P' 
GETPKEYS_6=and b.constraint_name = a.constraint_name
GETPKEYS_7=order by position
GETFKEYS_1=SELECT A.CONSTRAINT_NAME, B.OWNER, B.TABLE_NAME,B.COLUMN_NAME, 
GETFKEYS_2=C.OWNER, C.TABLE_NAME, C.COLUMN_NAME, B.POSITION
GETFKEYS_3=FROM ALL_CONSTRAINTS A, ALL_CONS_COLUMNS B, ALL_CONS_COLUMNS C
GETFKEYS_4=WHERE A.CONSTRAINT_TYPE = 'R'
GETFKEYS_5=AND B.CONSTRAINT_NAME = A.CONSTRAINT_NAME
GETFKEYS_6=AND C.CONSTRAINT_NAME = A.R_CONSTRAINT_NAME
GETFKEYS_7=AND C.POSITION = B.POSITION
GETINDEXES_1=select a.tablespace_name, a.index_name, a.uniqueness, b.column_name, b.column_position
GETINDEXES_2=from all_indexes a, all_ind_columns b
GETINDEXES_3=where a.owner = '&OWNERNAME&' and a.table_name = '&TABLENAME&'
GETINDEXES_4=and b.index_name = a.index_name order by b.column_position
GETCOLUMNS_NUM=2
GETPKEYS_NUM=7
GETFKEYS_NUM=7
GETINDEXES_NUM=4
GETVALIDMASKS_NUM=1
GETFORMATMASKS_NUM=1
GETEDITMASKS_NUM=1
GETEXTATTRIBUTES_NUM=1
GETTABLES_NUM=5
GETTABLES_2=from all_tables a, all_tab_comments b
GETTABLES_3=where b.owner = a.owner
GETTABLES_4=and b.table_name = a.table_name
GETTABLES_5=and a.owner != 'SYS'

[ODBC-TRIGGERS]
ENTRIES_NUM=7
ENTRIES_1=INSERTTRIGGER
ENTRIES_2=INSERT-PARENTEXIST
ENTRIES_3=UPDATETRIGGER
ENTRIES_4=UPDATE-PARENTEXIST
ENTRIES_5=UPDATE-PARENTCHANGE
ENTRIES_6=UPDATE-PARENTRESTRICT
ENTRIES_7=UPDATE-PARENTCASCADE         
INSERTTRIGGER_NUM=13
INSERT-PARENTEXIST_NUM=9
INSERTTRIGGER_1=/* INSERT TRIGGER FOR &TABLENAME& */
INSERTTRIGGER_2=create trigger ti_&TABLENAME& on &TABLENAME& for insert as
INSERTTRIGGER_3=begin
INSERTTRIGGER_4=declare @numrows int
INSERTTRIGGER_5=select @numrows = @@rowcount
INSERTTRIGGER_6=
INSERTTRIGGER_7=if @numrows = 0
INSERTTRIGGER_8=return
INSERTTRIGGER_9=
INSERTTRIGGER_10=~LOOP_PARENT("MANDATORY_PARENT", "INSERT-PARENTEXIST")~
INSERTTRIGGER_11=
INSERTTRIGGER_12=return
INSERTTRIGGER_13=end&END&&SENDTRANSACTION&&END&
INSERT-PARENTEXIST_1=/* Value must exist in parent "&FPARENTTABLENAME&" when inserting into "&FCHILDTABLENAME&"
INSERT-PARENTEXIST_2=IF ~CONCAT("update (&CHILDCOLUMN&)", "", " or", "")~
INSERT-PARENTEXIST_3=begin
INSERT-PARENTEXIST_4=if (select count(*)
INSERT-PARENTEXIST_5=from  &FPARENTTABLENAME& a, inserted b
INSERT-PARENTEXIST_6=where ~CONCAT("a.&PARENTCOLUMN& = b.&CHILDCOLUMN&", "and   ", "", ")= @numrows")~
INSERT-PARENTEXIST_7=raiserror 20001 'Can not insert into "&FCHILDTABLENAME&" unless value exists in "&FPARENTTABLENAME&"'
INSERT-PARENTEXIST_8=rollback transaction
INSERT-PARENTEXIST_9=end&END&
UPDATETRIGGER_1=This is some text
UPDATETRIGGER_2=for the update trigger
UPDATETRIGGER_3=just to see if the save works or not&END&
UPDATETRIGGER_NUM=3
UPDATE-PARENTEXIST_1=PARENT EXIST LOOP
UPDATE-PARENTEXIST_2=
UPDATE-PARENTEXIST_3=LOOP END
UPDATE-PARENTEXIST_NUM=3
