T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
SQL interface to the internal T4x database

Namespaces

 API::Core::Sql
 SQLlite interface to the internal T4x database.
 

Functions

 begin databaseRef
 Marks the begin of a database transaction. More...
 
 commit databaseRef
 Marks the completion of a database transaction as successful. More...
 
 connect databaseRef databaseFileName
 Opens a connection with a database. More...
 
 createIndex databaseRef indexName tableName columnNameList args
 Creates an index. More...
 
 createTable databaseRef tableName columnNameTypeList args
 Creates a table. More...
 
 delete databaseRef tableName whereCondition
 Deletes one or more rows from a table. More...
 
 deleteIndex databaseRef indexName
 Deletes an index. More...
 
 deleteTable databaseRef tableName
 Deletes a table. More...
 
 disconnect databaseRef
 Closes a connection with a database. More...
 
 executeSql databaseRef sqlStatement
 Executes an SQL statement. More...
 
 explainSql databaseRef sqlStatement
 Retrieves the execution plan of an SQL statement without executing the statement. More...
 
 export databaseRef tableName filePath
 Exports the content of a table to a CSV (tab-separated) file. More...
 
 getIndexInfo databaseRef indexName
 Retrieves meta information about an index. More...
 
 getIndexInfoList databaseRef
 Retrieves meta information about all indexes in the database. More...
 
 getShowSql
 Tells, if SQL statements are shown. More...
 
 getTableInfo databaseRef tableName
 Retrieves meta information about a table. More...
 
 getTableInfoList databaseRef
 Retrieves meta information about all tables in the database. More...
 
 import databaseRef tableName filePath
 Imports the content of a CSV (tab-separated) file to a table. More...
 
 insert databaseRef tableName columnValueList
 Inserts a row into a table. More...
 
 optimizeSpace databaseRef
 Optimizes the database with respect to space. More...
 
 optimizeTime databaseRef
 Optimizes the database with respect to time. More...
 
 rollback databaseRef
 Marks the completion of a database transaction as not successful. More...
 
 select databaseRef columnNameList tableNameList whereCondition args
 Retrieves one or more rows of one or more tables. More...
 
 setShowSql showSql
 Changes, if SQL statements are shown. More...
 
 update databaseRef tableName columnNameValueList whereCondition
 Updates one or more rows of a table. More...
 

Detailed Description

Function Documentation

◆ begin()

API::Core::Sql::begin   databaseRef  

Marks the begin of a database transaction.

Transactions may be nested

Parameters
databaseRefa reference to a variable name representing the database
Returns
1=ok 0=error

◆ commit()

API::Core::Sql::commit   databaseRef  

Marks the completion of a database transaction as successful.

In case there is no transaction nesting, the effects of the transaction are made permanent. In case there is transaction nesting, the outermost transaction commits successfully if and only if all transactions including the subtransactions commit successfully. In this case the effects of all transactions are made permanent

Parameters
databaseRefa reference to a variable name representing the database
Returns
1=ok 0=error

◆ connect()

API::Core::Sql::connect   databaseRef databaseFileName  

Opens a connection with a database.

Parameters
databaseRefa reference to a variable name representing the database
databaseFileNamethe file name of the database file
Returns
1=ok 0=error

◆ createIndex()

API::Core::Sql::createIndex   databaseRef indexName tableName columnNameList args  

Creates an index.

Parameters
databaseRefa reference to a variable name representing the database
indexNamethe index name
tableNamethe table name
columnNameLista list of column names, e.g [list b c]
args(optional) constraints
  • if "unique": a list defining if the index has to be unique, e.g. [list unique]
Returns
1=ok 0=error

◆ createTable()

API::Core::Sql::createTable   databaseRef tableName columnNameTypeList args  

Creates a table.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe table name
columnNameTypeLista list of column names and types, e.g. [list a integer b text c "text|unique|not null" d integer]
args(optional) constraints
  • if "primaryKey": a list defining a primary key, e.g. [list primaryKey a]
  • if "foreignKey": a list defining a foreign key, e.g. [list foreignKey d table1]
  • if "check": a list defining a check constraint, e.g. [list check "b LIKE 'tes%plm%are'"]
Returns
1=ok 0=error

◆ delete()

API::Core::Sql::delete   databaseRef tableName whereCondition  

Deletes one or more rows from a table.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe table name
whereConditiona condition specifying which rows to delete
Returns
1=ok 0=error

◆ deleteIndex()

API::Core::Sql::deleteIndex   databaseRef indexName  

Deletes an index.

Parameters
databaseRefa reference to a variable name representing the database
indexNamethe index name
Returns
1=ok 0=error

◆ deleteTable()

API::Core::Sql::deleteTable   databaseRef tableName  

Deletes a table.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe table name
Returns
1=ok 0=error

◆ disconnect()

API::Core::Sql::disconnect   databaseRef  

Closes a connection with a database.

Parameters
databaseRefa reference to a variable name representing the database
Returns
1=ok 0=error

◆ executeSql()

API::Core::Sql::executeSql   databaseRef sqlStatement  

Executes an SQL statement.

Parameters
databaseRefa reference to a variable name representing the database
sqlStatementthe SQL statement
Returns
statement result=ok ""=error

◆ explainSql()

API::Core::Sql::explainSql   databaseRef sqlStatement  

Retrieves the execution plan of an SQL statement without executing the statement.

Parameters
databaseRefa reference to a variable name representing the database
sqlStatementthe SQL statement
Returns
execution plan=ok ""=error

◆ export()

API::Core::Sql::export   databaseRef tableName filePath  

Exports the content of a table to a CSV (tab-separated) file.

If the file does not exist, the file is created; otherwise, the file is overwritten.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe name of the table
filePaththe file path of the file
Returns
1=ok 0=error

◆ getIndexInfo()

API::Core::Sql::getIndexInfo   databaseRef indexName  

Retrieves meta information about an index.

Parameters
databaseRefa reference to a variable name representing the database
indexNamethe index name
Returns
index info=ok ""=error

◆ getIndexInfoList()

API::Core::Sql::getIndexInfoList   databaseRef  

Retrieves meta information about all indexes in the database.

Parameters
databaseRefa reference to a variable name representing the database
Returns
index info=ok ""=error

◆ getShowSql()

API::Core::Sql::getShowSql

Tells, if SQL statements are shown.

Returns
1=yes 0=no ""=error

◆ getTableInfo()

API::Core::Sql::getTableInfo   databaseRef tableName  

Retrieves meta information about a table.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe table name
Returns
table info=ok ""=error

◆ getTableInfoList()

API::Core::Sql::getTableInfoList   databaseRef  

Retrieves meta information about all tables in the database.

Parameters
databaseRefa reference to a variable name representing the database
Returns
table info=ok ""=error

◆ import()

API::Core::Sql::import   databaseRef tableName filePath  

Imports the content of a CSV (tab-separated) file to a table.

If the table does not exist, an error is raised

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe name of the table
filePaththe file path of the file
Returns
1=ok 0=error

◆ insert()

API::Core::Sql::insert   databaseRef tableName columnValueList  

Inserts a row into a table.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe table name
columnValueLista list of column values, e.g [list NULL 1 "'new string value'"]
Returns
1=ok 0=error

◆ optimizeSpace()

API::Core::Sql::optimizeSpace   databaseRef  

Optimizes the database with respect to space.

Parameters
databaseRefa reference to a variable name representing the database
Returns
1=ok 0=error

◆ optimizeTime()

API::Core::Sql::optimizeTime   databaseRef  

Optimizes the database with respect to time.

Parameters
databaseRefa reference to a variable name representing the database
Returns
1=ok 0=error

◆ rollback()

API::Core::Sql::rollback   databaseRef  

Marks the completion of a database transaction as not successful.

In case there is no transaction nesting, the effects of the transaction are made undone. In case there is transaction nesting, the outermost transaction rolls back successfully if and only if any transaction including the subtransactions rolls back successfully. In this case the effects of all transactions are made undone

Parameters
databaseRefa reference to a variable name representing the database
Returns
1=ok 0=error

◆ select()

API::Core::Sql::select   databaseRef columnNameList tableNameList whereCondition args  

Retrieves one or more rows of one or more tables.

Parameters
databaseRefa reference to a variable name representing the database
columnNameLista list of column names, e.g. [list tab1.a tab1.b tab2.a tab2.c]
tableNameLista list of table names, e.g. [list tab1 tab2]
whereConditiona condition specifying which rows to retrieve
args(optional) additional arguments
  • if "distinct": a list defining if only distinct values for the specified columns are allowed, e.g. [list distinct]
  • if "orderBy": a list defining the columns to order by, e.g. [list orderBy tab1.a tab2.a]
Returns
table rows=ok ""=error

◆ setShowSql()

API::Core::Sql::setShowSql   showSql  

Changes, if SQL statements are shown.

Parameters
showSqlif SQL statements are shown: 1 = "yes", 0 = "no"
Returns
1=ok 0=error

◆ update()

API::Core::Sql::update   databaseRef tableName columnNameValueList whereCondition  

Updates one or more rows of a table.

Parameters
databaseRefa reference to a variable name representing the database
tableNamethe table name
columnNameValueLista list of column names and values, e.g [list a 100 b 'luck']
whereConditiona condition specifying which rows to update
Returns
1=ok 0=error