Samples

The samples in this document include:


Generated GFFT and Schema Sample

The sample in this section shows a generated field table (GFFT) and its corresponding XML schema.

Generated Field Table (GFFT)

The field table is created when you generate a global format buffer for a subscription in Event Replicator for Adabas. It is generated from Predict file definitions. To generate a global format buffer and field table (GFFT) using the Adabas Event Replicator Subsystem, read Generating a GFB.

I T L DB Name                             F       Leng S D Remark
- - - -- -------------- top ------------- - ---------- - - -----------

    1 AA PERSONNEL-ID                     A          8   D
  G 1 AB FULL-NAME
    2 AC FIRST-NAME                       A         20 N
    2 AD MIDDLE-I                         A          1 N
    2 AE NAME                             A         20   D
    1 AF MAR-STAT                         A          1 F
  *      M=MARRIED
  *      S=SINGLE
  *      D=DIVORCED
  *      W=WIDOWED
    1 AG SEX                              A          1 F
  G 1 A1 FULL-ADDRESS
    2 AJ CITY                             A         20 N D
    2 AK ZIP                              A         10 N
    2 AL COUNTRY                          A          3 N
  G 1 A2 TELEPHONE
    2 AN AREA-CODE                        A          6 N
    2 AM PHONE                            A         15 N
    1 AO DEPT                             A          6   D
    1 AP JOB-TITLE                        A         25 N D
  G 1 A3 LEAVE-DATA
    2 AU LEAVE-DUE                        N        2.0
    2 AV LEAVE-TAKEN                      N        2.0 N

Schema and Replicated Data

The XML schema for the data is created from the generated field table (GFFT) for the subscription that processed the replicated data. It is provided in the Create operation in the sample below. Insert, Update, and Delete operations for the replicated data are also shown in the sample. The Create operation will create the SQL table in the RDBMS, the Insert operation will insert replicated data into the created SQL table, the Update operation will update replicated data in the SQL table, and the Delete operation will delete replicated data in the SQL table. The name of the table created is determined by combining the name of the subscription (PAYROLL in this sample) with the name of the schema file (EMPLOYEES in this sample): PAYROLL_EMPLOYEES. The names of the columns in the table are taken from the long names in the field table.

Note:
If no primary key specified, the ISN will be used as the primary key. The primary key must be defined as an Adabas Unique Descriptor.

EXAMPLE "Create":

<TransactionPart Sub='SUB1' Origin='I' Prefix='N' Part='1' Id='C0CF513C08C1F20400000000' En='4091'>
	<Event Row='1' File='EMPLOYEES-FILE' Op='Create' Time='2007/06/27-15:20:42.444665' FNR='10'>
		<Field name='PERSONNEL-ID' ei='1' fmt='string' prc='0' len='8' key='uk'/>
		<Field name='FIRST-NAME' ei='2' fmt='string' prc='0' len='20'/>
		<Field name='NAME' ei='3' fmt='string' prc='0' len='20' key='ky'/>
		<Field name='MIDDLE-NAME' ei='4' fmt='string' prc='0' len='20'/>
		<Field name='MAR-STAT' ei='5' fmt='string' prc='0' len='1'/>
		<Field name='SEX' ei='6' fmt='string' prc='0' len='1'/>
		<Field name='BIRTH' ei='8' fmt='date' prc='0' len='10' key='ky'/>
		<Field name='ADDRESS-LINE' ei='9' fmt='string' prc='0' len='20' att='mu'/>
		<Field name='CITY' ei='10' fmt='string' prc='0' len='20' key='ky'/>
		<Field name='POST-CODE' ei='11' fmt='string' prc='0' len='10'/>
		<Field name='COUNTRY' ei='12' fmt='string' prc='0' len='3'/>
		<Field name='AREA-CODE' ei='13' fmt='string' prc='0' len='6'/>
		<Field name='PHONE' ei='14' fmt='string' prc='0' len='15'/>
		<Field name='DEPT' ei='15' fmt='string' prc='0' len='6' key='ky'/>
		<Field name='JOB-TITLE' ei='16' fmt='string' prc='0' len='25' key='ky'/>
		<Field name='CURR-CODE' ei='18' fmt='string' prc='0' len='3' att='pe' gname='INCOME'/>
		<Field name='SALARY' ei='19' fmt='decimal' prc='0' len='10' att='pe' gname='INCOME'/>
		<Field name='BONUS' ei='20' fmt='decimal' prc='0' len='10' att='mu' gname='INCOME'/>
		<Field name='LEAVE-DUE' ei='21' fmt='decimal' prc='0' len='2'/>
		<Field name='LEAVE-TAKEN' ei='22' fmt='decimal' prc='0' len='2'/>
		<Field name='LEAVE-START' ei='24' fmt='decimal' prc='0' len='8' att='pe' gname='LEAVE-BOOKED'/>
		<Field name='LEAVE-END' ei='25' fmt='decimal' prc='0' len='8' att='pe' gname='LEAVE-BOOKED'/>
		<Field name='LANG' ei='26' fmt='string' prc='0' len='3' att='mu'/>
    <Alias name='INCOME' ei='17'/>
    <Alias name='LEAVE-BOOKED' ei='23'/>
	</Event>
	<TransactionEnd RowCount='1' DBID='44444' Sent='2007/06/27-15:20:58.782005' Committed='2007/06/27-15:20:58.434591' Version='1.0'/>
</TransactionPart>

EXAMPLE "Insert":

<TransactionPart Sub='SUB1' Origin='I' Prefix='N' Part='1' Id='C0D5D7140B13D3C900000000' En='4091'>
	<E Row='1' File='EMPLOYEES-FILE' ISN='1' Op='Insert' FNR='10'>
		<F ei='1' ai='50005800' key='uk'/>
		<F ei='2' ai='SIMONE'/>
		<F ei='3' ai='ADAM' key='ky'/>
		<F ei='5' ai='M'/>
		<F ei='6' ai='F'/>
		<F ei='8' ai='1952/01/30' key='ky'/>
		<F ei='9' ai='26 AVENUE RHIN ET DA' att='mu' ix='1'/>
		<F ei='10' ai='JOIGNY' key='ky'/>
		<F ei='11' ai='89300'/>
		<F ei='12' ai='F'/>
		<F ei='13' ai='1033'/>
		<F ei='14' ai='44864858'/>
		<F ei='15' ai='VENT59' key='ky'/>
		<F ei='16' ai='CHEF DE SERVICE' key='ky'/>
		<F ei='18' ai='FRA' att='pe' ix='1' gei='17'/>
		<F ei='19' ai='159980' att='pe' ix='1' gei='17'/>
		<F ei='20' ai='23000' ix='1' ix2='1' att='mu' gei='17'/>
		<F ei='21' ai='19'/>
		<F ei='22' ai='5'/>
		<F ei='24' ai='19990801' att='pe' ix='1' gei='23'/>
		<F ei='25' ai='19990831' att='pe' ix='1' gei='23'/>
		<F ei='26' ai='FRE' att='mu' ix='1'/>
		<F ei='26' ai='ENG' att='mu' ix='2'/>
	</E>
	<TransactionEnd RowCount='10' DBID='44444' Sent='2007/07/02-19:51:44.051797' Committed='2007/07/02-19:51:43.712573' Version='1.0'/>
</TransactionPart>

EXAMPLE "Update":

<TransactionPart Sub='SUB1' Origin='I' Prefix='N' Part='1' Id='C0D5D7140B13D3C900000000' En='4091'>
	<E Row='1' File='EMPLOYEES-FILE' ISN='10' Op='Update' FNR='10'>
		<F ei='1' bi='50004000' ai='11111111' key='uk'/>
		<F ei='20' bi='8880' ai='0000' ix='1' att='mu' ix2='1' gei='17'/>
		<F ei='18' bi='USD' ai='TWN' att='pe' ix='31' gei='17'/>
		<F ei='26' bi='ENG' ai='CHN' att='mu' ix='2'/>
	</E>
	<TransactionEnd RowCount='1' DBID='44444' Sent='2007/07/08-19:51:44.051797' Committed='2007/07/08-19:51:43.712573' Version='1.0'/>
</TransactionPart>

EXAMPLE "Delete":

<TransactionPart Sub='SUB1' Origin='I' Prefix='N' Part='1' Id='C0D5D7140B13D3C900000000' En='4091'>
	<E Row='1' File='EMPLOYEES-FILE' ISN='10' Op='Delete' FNR='10'>
	</E>
	<TransactionEnd RowCount='1' DBID='44444' Sent='2007/07/09-19:51:44.051797' Committed='2007/07/09-19:51:43.712573' Version='1.0'/>
</TransactionPart>