Customizing the KB SQL Server Install Process
Total Page:16
File Type:pdf, Size:1020Kb
Customizing the KB_SQL Server Install Process
The Software Install Process is designed to prepare a designated M environment for SQL access using the KB_SQL product. The process can be customized to allow packaging of customer object definitions together with the base product. This section describes how to customize the install process using the user-defined script file SQLSCR.USR. This file is a part of the server installation files. To enable this feature, you must copy your revised file to the load directory as the file SQLSCR.2.
Customization is accomplished by adding script steps to the user-defined script file, SQLSCR.USR. Each line of this file can contain a coded command and associated arguments and message text. This file will be processed after all product installation steps are complete.
Contents Customizing the KB_SQL Server Install Process...... 1 SQLSCR.USR...... 2 Customization Types...... 4 1 – KBS Routine Import...... 4 2 – KBS Global Import...... 4 3 – Routine Execute...... 5 4 – Prompt...... 5 5 – Import Table Definitions...... 5 6 – Import Query Definitions...... 6 7 – Import Device Type Definitions...... 6 8 – Execute M Code...... 6 9 – Import Function Definitions...... 7 10 – Import Pseudo Column Definitions...... 7 11 – Import Table Statistics...... 7 12 – Global Import from XFER Export File...... 8 13 – Import Routine Data...... 8
SQLSCR.USR
The following text is taken from the on-line copy of SQLSCR.USR.
; Knowledge Based Systems, Inc. ; SQLSCR.USR. ; User-defined Script ; ; This file can be modified by the customer in order to extend the ; product installation process. ; ; Types ; ===== ; OKVar~1~Filename~Import Routine source ; OKVar~2~Filename~Import Global data ; OKVar~3~RoutineToRun~Message ; OKVar~4~PromptText~PromptVar~PromptDefault ; OKVar~5~Filename~Import Table definitions ; OKVar~6~Filename~Import Query definitions ; OKVar~7~Filename~Import Device Type definitions ; OKVar~8~ExecuteMCode~Message ; OKVar~9~Filename~Import Function definitions ; OKVar~10~Filename~Import Pseudo Column definitions ; OKVar~11~Filename~Import Table Statistics ; OKVar~12~Filename~Import Global data ; OKVar~13~Filename~Import Routine data ; ; Variables ; ======; Customers should use variables in the SQLA-, SQLB- namespaces. ; Context variables (inherited from product install) ; OK Always true ; OKI True for INSTALL only ; OKU True for UPDATE only ; ; Example ; ======; This script imports customer defined tables, queries and functions ; for the fictitious LAB application. ; ; Note: Simply remove the leading semi-colon to enable a line of the ; script. ; ; OKU~1~FIXUP.RTN~Load FIXUP routines ; Note: This step is run only for updates (OKU). ; OKU~8~d FIXUP^SQLAA~Cleanup ; Note: This routine was loaded by the previous step. ; OK~5~LAB Table Definitions ; Note: This step is run for installs and updates (OK). ; OK~6~LAB.Q~LAB query Definitions ; OK~9~LAB.FN~LAB Function Definitions ; OKI~2~SITEDEF.GBL~Load global defaults for Site Definition ; Note: This step is run only for new installs (OKI). Customization Types
For each of the customization types, it is necessary to specify the context in which the command should be run:
OK Perform for both new installations and upgrades OKI Perform only for new installations OKU Perform only for upgrades
1 – KBS Routine Import
Description Imports the routine(s) file into the area where KB_SQL is installed.
Please note this type should only be used with the assistance of Knowledge Based Systems. This type is intended for use only in situations when KBS must provide custom routines.
Format
Sample OK~1~FIXUP.RTN~Load FIXUP routines Script Entry
Sample 1001 11/04/2002@02:00.58 PM Loading routine file: FIXUP.RTN Output =>Load FIXUP routines
2 – KBS Global Import
Description Imports the global(s) contained in the specified file into the area where KB_SQL is installed.
Please note this type should only be used with the assistance of Knowledge Based Systems. This type is intended for use only in situations when KBS must provide custom globals.
Format
Sample OK~2~FIXUP.G~Load FIXUP globals Script Entry
Sample 1001 11/04/2002@02:00.58 PM Loading routine file: FIXUP.G Output =>Load FIXUP globals
3 – Routine Execute
Description Executes an M routine.
Format
Sample OK~3~MAKE^SQLAVIEW~Create views Script Entry
Sample 1001 11/06/2002@11:12.58 AM Running routine SQLAVIEW Output =>Create views
4 – Prompt
Description Prompts the user for a value which is stored in a variable.
Format
Sample Script OK~4~Set TEST global?~SETGBL~Yes Entry ; Following the above with the next line would set the global based ; on the user’s input
SETGBL~8~S ^TEST($H)=1~Set ^TEST global
Sample OutputSet TEST global?
5 – Import Table Definitions
Description Imports table definitions.
The file is expected to have been created using KB_SQL’s table export utility found under UtilitiesExportTable, or XFER for table.
Format
Sample OK~5~STUDENTS.T~Import STUDENT table Script Entry Sample 1001 11/06/2002@11:34.22 AM Loading table file: STUDENTS.T Output =>Import STUDENTS table
6 – Import Query Definitions
Description Imports query definitions.
The file is expected to have been created using KB_SQL’s query export utility found under UtilitiesExportQuery, or XFER for query.
Format
Sample OK~6~QUERY.Q~Import query definitions Script Entry
Sample 1001 11/06/2002@11:34.22 AM Loading query file: QUERY.Q Output =>Import query definitions
7 – Import Device Type Definitions
Description Imports device type definitions.
The file is expected to have been created using KB_SQL’s device type export utility found under UtilitiesExportDevice Type, or XFER for device type.
Format
Sample OK~7~PRINTERS.D~Import device definitions Script Entry
Sample 1001 11/06/2002@11:34.22 AM Loading query file: PRINTERS.D Output =>Import device definitions
8 – Execute M Code
Description Executes the specified M code.
Format
Sample 1001 11/08/2002@01:49.13 PM Executing M code: D C^SQLAVIEW Output =>Call tag to create views
9 – Import Function Definitions
Description Imports function definitions.
The file is expected to have been created using KB_SQL’s function export utility found under UtilitiesExportFunction, or XFER for function.
Format
Sample OK~9~FUNCTION.F~Import function definitions Script Entry
Sample 1001 11/06/2002@11:34.22 AM Loading query file: FUNCTION.F Output =>Import function definitions
10 – Import Pseudo Column Definitions
Description Imports pseudo column definitions.
The file is expected to have been created using KB_SQL’s device type export utility found under UtilitiesExportPseudo Column, or XFER for pseudo column.
Format
Sample OK~10~PSEUDO.P~Import pseudo columns Script Entry
Sample 1001 11/06/2002@11:34.22 AM Loading query file: PSEUDO.P Output =>Import pseudo columns
11 – Import Table Statistics Description Imports device type definitions.
The file is expected to have been created using XFER for statistics. For example, >; Export table statistics: >S SQLXTO="STATS" >S SQLXTM="TO_FILE" >S SQLFILE="C:\TEMP\STAT.T" >; Replace K4 on the following line with the table id >S ^SQLEX($J,"STATS",K4)="" >D XFER^SQL
Format
Sample OK~11~STAT.T~Import table statistics Script Entry
Sample 1001 11/08/2002@02:33.34 PM Loading Statistics file: STAT.T Output =>Import table statistics
12 – Global Import from XFER Export File
Description Imports global data using KB_SQL’s XFER transfer utility.
The file is expected to have been created using XFER for GLOBAL. For example, >; export three globals named NAME, CITY, and STATE >S SQLXTO=”GLOBAL” >S SQLXTM=”TO_FILE” >S SQLFILE=”C:\TEMP\DATA.G” >S SQLXNM(1)=”^NAME” >S SQLXNM(2)=”^CITY” >S SQLXNM(3)=”^STATE” >D XFER^SQL
Note that when importing globals, the overwrite mode (SQLOW) value can be used to replace (SQLOW=1) an entire global tree, or merge (SQLOW=2) with an existing global tree. If the overwrite mode is create (SQLOW=0), the import will only be allowed if the global tree does not already exist.
Format
Sample OK~12~DATA.G~Data for name, city, state Script Entry Sample 1001 11/06/2002@12:06.20 PM Loading Global xfer file: DATA.G Output =>Data for name, city, state
13 – Import Routine Data
Description Imports a routine using KB_SQL’s XFER transfer utility for routines.
An export file must have been created using XFER for ROUTINE. For example, >; export three routines named NAME, CITY, and STATE >S SQLXTO=”ROUTINE” >S SQLXTM=”TO_FILE” >S SQLFILE=”C:\TEMP\RTN.R” >S SQLXNM(1)=”NAME” >S SQLXNM(2)=”CITY” >S SQLXNM(3)=”STATE” >D XFER^SQL
Format
Sample OK~13~RTN.R~Routines for name, city, state Script Entry
Sample 1001 11/06/2002@12:06.20 PM Loading Routine xfer file: RTN.R Output =>Routines for name, city, state