%SQL.Util.Importhidden class %SQL.Util.Import
The SQL dialect of the source statements
The directory containing files to be imported
If echoMode is true then the source statement and the result of executing it are displayed on the current device.
End of Statement delimiter. This is typically a semi-colon or 'GO'.
The number of seconds to pause after reporting an error.
The input stream object.
The log object.
logOption specifies the type of logging to perform. 0 - no logging 1 - log to a single file (always the case for importStream) 2 - log to separate files when importing a directory, each file loaded will produce a separate log file whose name is the same as the current input file with the extension of ".log" replacing the original extension. Unsupported statements are still written to a single file. If the log file name generated by replacing the input file name's extension with 'log' already exists then it will be appended.
This method converts the statement delimiter in a file containing SQL statements from the specified delimited into "GO". The "GO" delimiter is the only delimiter recognized by the TSQL parser in batch mode. Call this method, passing in the input file, the output file, the current statement delimiter and the translate table to use for the files. The converted statement output is saved to the output file. This method is not exact but it attempts to locate the end of statement by searching for the statement type and detecting embedded statement delimiters. Some CREATE PROCEDURE, CREATE FUNCTION, and CREATE TRIGGER statements can be incorrectly converted. It is the responsiblity of the user to verify the EOS conversion for all statements.
CreateRoutine creates an SQL Invoked Routine in a class definition. SQL Invoked Routines (SIRs) are functions and procedures. A function accepts an arbitrary number of INPUT parameters and returns a single value. A procedure accepts an arbitrary number of INPUT, INPUT-OUTPUT, and OUTPUT values, may return a value and may return DYNAMIC result sets. An SIR is implemented in COS, TSQL, or ???. Called from %Compiler.TSQL.COS
pMessageMode - if true, status and progress messages are displayed on the current device. pEcho - if true, each statement loaded and the result of executing it will be displayed on the current device. pCumulative - internal argument. If true then error information and counts accumulate in a process-private global. pStatementDelimiter - end of statement delimiter, defaults to "GO".
ImportDirectory will import all files with an extension that matches the list of extensions included in the pExtensions argument. pDialect - this is the SQL dialect. Default is IRIS. Other valid values are MSSQLSERVER, MSSQL, and Sybase. Other dialects are supported by
%SYSTEM.SQL. pDirectory - the directory path containing files to be imported. pExtensions - a comma delimited list of file extensions to import. The default is "sql". pRecurse - if true, then the all subdirectories of pDirectory are also imported. pLogOption - if true, statements and execution results will be logged to the pLogFileName file. pLogFileName - name of the log file. pNoSupFileName - name of the file to log unsupported statements. pStatementDelimiter - end of statement delimiter, defaults to "GO". pMessageMode - if true then all messages reported by executing imported statements will be displayed on the current device. pEchoMode - if true, all statement source is displayed on the current device. pErrorPause - the number of seconds to pause when an error is reported. The default is five seconds.
internal method to retrieve all of the files currently in the directory and, if pRecurse is true, all subdirectories. Only files whose extension matches an extension in pExtension are retrieved.
This is the dialog for importing a file containing SQL statements. It gathers the input file name, log files, and display options before calling the import() method.
Convert a batch delimited by some character into a batch delimited by GO on a single line.