Example of How to Execute a Sample XML File
The sample XML and data files are provided under file_path\PSQL\samples\cobolschemaexec. For default locations of Pervasive PSQL files, see Where are the Pervasive PSQL files installed? in Getting Started With Pervasive PSQL.
To execute the XML file SampleMainTable.xml using Schema Executor perform the following steps.
1
Copy maintbl.mkd to the data file folder of the database to which you wish to connect.
For example, suppose that database "test" exists with a data file location of c:\data\test. Copy maintbl.mkd to c:\data\test.
2
3
cobolschemaexec file_path\PSQL\samples\cobolschemaexec\samplemaintable.xml test
4
On successful execution of Schema Executor, the table maintbl (as specified in the XML file) is created in the "test" database.
5
Additional Notes
This section provides notes pertaining to SELECT statements and table filters.
SELECT Statements
A SELECT query on an OCCURS table returns the following:
For example, you perform the query SELECT * FROM FIELD for the tables created by the execution of Schema Executor on the sample XML file file_path\PSQL\samples\cobolschemaexec\ SampleMainWithOccurs.xml.
The utility returns columns Id, OccursCounter, Field_1, Field_2 and Field_3
A SELECT query on a REDEFINES table returns all of the columns of the parent table and the columns of the REDEFINES table.
For example, you perform the query SELECT * FROM Redefined_group for the tables created by the execution of Schema Executor on the sample XML file file_path\PSQL\samples\ cobolschemaexec\SampleMainWithRedefines.xml.
The utility returns columns Id, Account_Num, Category, Redef_Struct_Num (all columns of the parent table), Redefined_field_1 (column of the REDEFINES table).
Table Filters
A table filter (referred to as “TABLEFILTER” in the sample XML files) is a filter condition for a particular table.
Provide a blank space between operands and the operator.
Example: Cust_Num = '100' (where Cust_Num is the column name)
Examples of valid TABLEFILTERs: