ENABLE_SCRIPTING¶
Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex
Scripting is used for testing and preparation. This command allows structural changes to be compiled and tested without actually making any of the changes. Any table restructuring done between this command and DISABLE_SCRIPTING will not actually be committed but will instead create a mock INT file. The script and INT file can then be retrieved and examined for testing purposes.
Syntax
ENABLE_SCRIPTING
Example
In this example, a script for creating the Inventory table along with the Inventory.int file will be created. The table will have a rowid insteand of a recnum field (DF_STRUCTEND_OPT_CREATE_ROWID_TABLE) and none of the columns will allow nulls (DF_STRUCTEND_OPT_FORCE_NOT_NULL). The MERTECH_WARNING_MESSAGE command has been added to stop the warning popup. It is not required.
This would be similiar to using the Migration Utility, Create Script SQL dialog where the Table Style is set to RowId Table and Create All Fields as NOT NULL is checked.
string sChunk
integer iLength
SET_DATABASE_NAME to "MyData"
//even though you are just scripting and not making any changes, the warning message will pop up unless you disable it.
MERTECH_WARNING_MESSAGE Disabled
open Inventory
ENABLE_SCRIPTING
create_table_from_dat_file Inventory.File_Number (DF_STRUCTEND_OPT_CREATE_ROWID_TABLE+DF_STRUCTEND_OPT_FORCE_NOT_NULL) "Inventory"
DISABLE_SCRIPTING
close Inventory
GET_SQL_SCRIPT_CHUNK OFFSET 0 to sChunk iLength
Showln sChunk