Previous Topic Next topic Print topic


CREATE SUBSCHEMA

Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Use the CREATE SUBSCHEMA statement to:

  • Provide a copybook name (other than the default) for a particular data view contained in the SQLDDL file.
  • Add a column or table prefix or suffix to enable reuse of a single table or column in multiple places in your working storage.
  • Specify a mixed SQL target.

Insert the CREATE SUBSCHEMA statement as the first entry in your SQLDDL file.

Syntax: for Format 1:

Use this format to provide a copybook name for a data view.

CREATE SUBSCHEMA subschemaname [(table/viewname1 
[copylib 'copybookmembername'],[table/viewname2 
[copylib 'copybookmembername'], ... );

Syntax: for Format 2:

Use this format to specify a column or table prefix or suffix.

CREATE SUBSCHEMA subschemaname [(table/viewname1 
[TABLEPREFIX|TABLESUFFIX|COLUMNPREFIX|COLUMNSUFFIX 
'string'],[table/viewname2 
[TABLEPREFIX|TABLESUFFIX|COLUMNPREFIX|COLUMNSUFFIX 
'string'], ... );

Syntax: for Format 3:

Use this format to specify tables and views of different targets.

CREATE SUBSCHEMA subschemaname (tablename1 TARGET 
sqltarget, tablename2 TARGET sqltarget ...)

Parameters:

subschemaname

Must be identical to your SQLDDL file name.

table

The table name that contains the view you want to reference with a copybook name.

viewnameN

The name of the view you want to reference.

copybook

Overrides the default names generated for each table copybook named.

copybookmember-name

The copybook name you want to use to reference the view.

TABLEPREFIX|TABLESUFFIX|COLUMNPREFIX|COLUMNSUFFIX

Specify which prefix or suffix you want to provide, table or column.

string

The text string you want to use as the prefix or suffix.

tablenameN

The table for which you want to specify an alternate SQL target.

sqltarget

Specify an SQL target for the table.

Example:

CREATE SUBSCHEMA Latims (tsinvnt.tmobchctl copylib 'bchctl', 
tsinvnt.tmsaccref copylib 'accref', tsinvnt.tmsagnref copylib 
'agnref', tsinvnt.tmsasnmst copylib 'asnmst', 
tsinvnt.tmsassref copylib 'assref', tsinvnt.tmsbdgzref copylib 
'bdgref', tsinvnt.tmscltref copylib 'cltref', 
tsinvnt.tmscltrul copylib 'cltrul', tsinvnt.tmscrsref copylib 
'crsref', tsinvnt.tmsctlatv copylib 'ctlatv', 
tsinvnt.tmsdspref copylib 'dspref');
Previous Topic Next topic Print topic