Static Public Member Functions | |
_.Library.Status | CreateLinkedProcedure (_.Library.String dsn, _.Library.String externalSchema, _.Library.String externalProcedure, _.Library.String localPackage, _.Library.String localClass, _.Library.String localMethod, _.Library.String localSqlName, _.Library.String description) |
Create a linked process. More... | |
_.Library.Status | CreateLinkedTable (_.Library.String dsn, _.Library.String externalSchema, _.Library.String externalTable, _.Library.String primaryKeys, _.Library.String localClass, _.Library.String localTable, _.Library.String columnMap) |
Create a linked table. More... | |
_.Library.String | Default () |
Return the default schema name for the current process in the current namespace. More... | |
_.Library.Status | DropTable (_.Library.String tablename, _.Library.Boolean dropData) |
This entry point can be used to delete a table definition. More... | |
_.Library.Status | DropView (_.Library.String viewname) |
This entry point can be used to delete a view definition. More... | |
_.Library.Status | ExportDDL (_.Library.String schema, _.Library.String table, _.Library.String file, _.Library.DynamicObject qualifiers) |
Export a SQL DDL/DML script file containing Table/View definitions, User definitions, Role definitions, and/or Table/View Privileges based on the qualifiers argument (see below). More... | |
_.Library.Status | GetAllColumns (_.Library.String tablename, _.Library.String byName, _.Library.String byNumber) |
Given a table name, return a list of columns by name with the column number, and a list of columns sorted by column number with the name. More... | |
_.Library.Status | GetVisibleColumns (_.Library.String tablename, _.Library.String byName, _.Library.String byNumber) |
Given a table name, return a list of columns by name with the column number, and a list of columns sorted by column number with the name. More... | |
ImportDDL (_.Library.String infile, _.Library.String logfile, _.Library.String DDLMode) | |
Import a DDL/DML script file. More... | |
_.Library.Status | ImportDDLDir (_.Library.String directory, _.Library.String DDLMode, _.Library.DynamicObject qualifiers) |
Import all DDL/DML script file in a given directory. More... | |
_.Library.Status | ImportDir (_.Library.String dialect, _.Library.String directory, _.Library.DynamicObject qualifiers) |
Import all DDL/DML script files in a given directory. More... | |
_.Library.String | LoadFDBMS () |
Import a FDBMS DDL script file. | |
_.Library.String | LoadInformix () |
Import an Informix DDL/DML script file. More... | |
_.Library.String | LoadInterBase () |
Import an Interbase DDL/DML script file. More... | |
_.Library.String | LoadMSSQLServer () |
Import an MS SQL Server DDL/DML script file. More... | |
_.Library.String | LoadOracle () |
Import an Oracle DDL/DML script file. More... | |
_.Library.String | LoadSybase () |
Import a Sybase DDL/DML script file. More... | |
_.Library.String | LoadTSQL () |
Import a TSQL script file. More... | |
_.Library.Boolean | ProcedureExists (_.Library.String procname, _.Library.String metadata) |
This entry point can be used to determine if a stored procedure exists. More... | |
_.Library.Status | Run () |
Import an IRIS SQL script file. More... | |
_.Library.Status | SetDefault (_.Library.String schema, _.Library.String oldval, _.Library.Boolean Namespace) |
Sets the default schema used by SQL. More... | |
_.Library.Boolean | TableExists (_.Library.String tablename, _.Library.String metadata) |
This entry point can be used to determine if a base table exists. More... | |
_.Library.Status | ValidateTable (_.Library.String tablename, _.Library.BigInt index) |
Validate data for a table More... | |
_.Library.Boolean | ViewExists (_.Library.String viewname, _.Library.String metadata) |
This entry point can be used to determine if a view exists. More... | |
![]() | |
_.Library.String | Help (_.Library.String method) |
This is a helper class that is used by the various SYSTEM classes to provide a Help method. More... | |
|
static |
Create a linked process.
dsn - Data Source Name
externalSchema - Schema name of the linked stored procedure of external source
externalProcedure - External selected Stored Procedure name
localPackage - New Stored Procedure's Package name. Default value is "LinkedSchema".
localClass - New class name for the new Linked stored procedure. Default value is "LinkedProcedures"
localMethod - Method name for the stored procedure. Default value is externalProcedure.
localSqlName - New SQL name. Default value is externalProcedure.
description - Description. Default value is empty
|
static |
Create a linked table.
dsn - Data Source Name
externalSchema - Schema name of the linked table of external source
externalTable - The linked table name of external source
primaryKeys - The fields for the primary key of new created table.
Multiple fields are separated by comma. The primary key's field(s) should be specified as the "new class property name" if you do not use the original field name of the external source
You at least have to specify one field for this primaryKey.
localClass - The new linked class name. The default value is "User.LinkedClass"
localTable - The new table name for the linked class. Default value is localClass
columnMap - The linked fields of the external table. Default is to map everything as read-only columns if you don't specify anything in the map. Otherwise, specify the fields in the below format. columnMap("external field name") = $lb("new class property name","new sql field name","read-only"(1/0)) or use external field name as default values by specifying columnMap("external field name") = "".
"new class property name" and "new sql field name" could be defined empty and "external field name" would be used as their default values "read only" default is on.
Below is example for linking a table from MySQL
Use these commands to create a table in MySQL
in MySQL shell:
create database test1;
use test1;
create table Person(PID int,name varchar(255));
insert into Person(PID,name) values(1,"Cache")
in Cache Terminal:
$SYSTEM.SQL.Schema.CreateLinkedTable(dsn,"","Person","PID,name","User.LinkedClass","LinkedTable","")
would link all the fields of the table test1.Person from MySQL to the Cache class "User.LinkedTable"
and use both PID and name as primary keys
|
static |
Return the default schema name for the current process in the current namespace.
Example:
Set CurrentSchema = $SYSTEM.SQL.Schema.Default() This method can also be called as a Stored Procedure named SYSTEM_SQL.DefaultSchema()
|
static |
This entry point can be used to delete a table definition.
Parameters:
TRUE(1)/FALSE(0) flag which determine if the table's data is to be deleted or not. If dropData="" or undefined, use system flag to determine if data should be deleted.
Examples:
|
static |
This entry point can be used to delete a view definition.
Parameters:
Examples:
|
static |
Export a SQL DDL/DML script file containing Table/View definitions, User definitions, Role definitions, and/or Table/View Privileges based on the qualifiers argument (see below).
Parameters:
Examples:
The method returns a Status Code.
A file created via $SYSTEM.SQL.Schema.ExportDDL() can be imported using one of:
The ExportDDL() method will not export the following users and roles -
|
static |
Given a table name, return a list of columns by name with the column number, and a list of columns sorted by column number with the name.
This includes all SQL hidden columns.
Parameters:
Returns: A Status value
|
static |
Given a table name, return a list of columns by name with the column number, and a list of columns sorted by column number with the name.
This excludes all SQL hidden columns. SQL fields are defined as hidden if they are projected by a property defined as private, a RowID field defined as SqlRowIDPrivate, a RowID field for a linked table, a serial field that is not a collection and the storage structure is known, the %CLASSNAME field, or a list or array collection property projected as a child table.
Parameters:
|
static |
Import a DDL/DML script file.
Parameters:
DDLMode Vendor from which the script file originated. This parameter is required. Supported values are:
When DDLMode=IRIS, the following statements are supported:
Examples:
|
static |
Import all DDL/DML script file in a given directory.
All files with the extension .sql in the directory will be imported.
Parameters:
Examples:
|
static |
Import all DDL/DML script files in a given directory.
All files with the extension .sql in the directory will be imported.
The caller can optionally specify a comma delimited list of file extensions to import. Subdirectories are also recursively processed if the caller specifies the recurse qualifier as 1. The log for this command can be found in SQLImportDir.log within the input directory.
Parameters:
Examples:
|
static |
Import an Informix DDL/DML script file.
The Informix DDL/DML Import Utility supports the following statements:
Statements other than the ones above are not handled by the utility and must be added to your application manually (if applicable).
|
static |
Import an Interbase DDL/DML script file.
The Interbase DDL/DML Import Utility supports the following statements:
Statements other than the ones above are not handled by the utility and must be added to your application manually (if applicable).
|
static |
Import an MS SQL Server DDL/DML script file.
The MS SQL Server DDL/DML Import Utility supports the following statements:
Statements other than the ones above are not handled by the utility and must be added to your application manually (if applicable).
|
static |
Import an Oracle DDL/DML script file.
The Oracle DDL/DML Import Utility supports the following statements:
Statements other than the ones above are not handled by the utility and must be added to your application manually (if applicable).
|
static |
Import a Sybase DDL/DML script file.
The Sybase DDL/DML Import Utility supports the following statements:
Statements other than the ones above are not handled by the utility and must be added to your application manually (if applicable).
|
static |
Import a TSQL script file.
TSQL source files can contain any TSQL syntax supported by InterSystems IRIS TSQL.
This API will put the caller to the SQL Shell in the default TSQL dialect as defined in the TSQL Compatibility Settings.
The caller can then use the run [filename] command from the shell to import the script file.
|
static |
This entry point can be used to determine if a stored procedure exists.
Parameters:
Examples:
Notes:
This method can also be called as a Stored Procedure named SYSTEM_SQL.Schema_ProcedureExists(procname)
|
static |
|
static |
Sets the default schema used by SQL.
This configuration setting provides the ability to define a default schema name other than SQLUser, the default. When an unqualified table name is encountered in an SQL statement (and there is no #import statement specified), the default schema will be used. This setting has nothing to do with the mappings between SQL schema names and the class package name, it only specifies the default schema.
Parameter:
Returns:
Status Code
NOTES: - You must have the "USE" permission on the Admin Manage Resource in order to change this configuration setting. - Changing this configuration setting will affect all processes immediately.
|
static |
This entry point can be used to determine if a base table exists.
Parameters:
Examples:
Notes:
This method can also be called as a Stored Procedure named SYSTEM_SQL.Schema_TableExists(tablename)
|
static |
Validate data for a table
This utility can be called via $SYSTEM.SQL.Schema.ValidateTable(tablename) or as the SYSTEM_SQL.Schema_ValidateTable(tablename) stored procedure. This method/procedure returns a resultset that contains a row for each issue found with the table's data. If the resultset is empty, the table has no data validation issues. The table's data is checked for the following:
Each field's validation code from the IsValid method of the field's datatype Required fields do not have a null value Unique constraints do not have duplicate values Foreign Key fields reference valid rows in the referenced table
Parameters:
Returns: Status Code
Example: Set status=$SYSTEM.SQL.Schema.ValidateTable("Sample.Person") // Validates the data in the Sample.Person table Set status=$SYSTEM.SQL.Schema.ValidateTable("Company") // Validates the data in the SQLUser.Company table call SYSTEM_SQL.Schema_ValidateTable('Sample.Person') // Validates the data in the Sample.Person table via SQL
Notes:
|
static |
This entry point can be used to determine if a view exists.
Parameters:
Examples:
Notes:
This method can also be called as a Stored Procedure named SYSTEM_SQL.Schema_ViewExists(viewname)