#include <DatabaseSQLStatements.h>
Inheritance diagram for DatabaseSqlStatements:
Public Member Functions | |
virtual CStdString | getRecommendedColumnType (IopcDataType cxxDataType, int maxLength=0)=0 |
virtual int | checkColumnTypeCompatibility (IopcDataType cxxDataType, const char *dbDataType)=0 |
virtual CStdString | quoteString (const char *value)=0 |
virtual int | generateCreateTableSql (const DatabaseTableInfo &table, CStdString &createTableSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateCreateViewSql (const char *viewName, const std::list< CStdString > &viewColumns, const std::list< CStdString > &subSelects, CStdString &createViewSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateDropTableSql (const char *tableName, CStdString &dropTableSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateDropViewSql (const char *viewName, CStdString &dropViewSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateInsertSqlSimple (const char *tableName, const std::list< CStdString > &columnValues, CStdString &insertSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateInsertSqlUsingHostVariables (const char *tableName, const std::list< CStdString > &columns, CStdString &insertSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateUpdateSqlUsingHostVariables (const char *tableName, const std::list< CStdString > &columns, const char *whereClause, CStdString &updateSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateSelectSql (const std::list< CStdString > &columns, const std::list< CStdString > &tables, const char *whereClause, CStdString &selectSql, CStdString &warningsForUser, CStdString &errorForUser, const char *orderBy=NULL, bool lockRows=0, bool dontWait=0)=0 |
virtual int | generateDeleteSql (const char *tableName, const char *whereClause, CStdString &deleteSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateWhereClauseStmtPart (const std::list< CStdString > &conditions, CStdString &whereClause, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateConditionInSet (const char *columnToTest, const std::list< int > &valuesToTest, CStdString &condition, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateConditionEqualToHostVariable (const char *columnToTest, const char *hostVariableName, CStdString &condition, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateCreateIndexSql (const char *indexName, const char *tableName, const std::list< CStdString > &columns, bool unique, CStdString &createIndexSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateDropIndexSql (const char *indexName, CStdString &dropIndexSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateExplainPlanScript (const char *query, const char *queryID, CStdString &explainPlanSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateOidGenerationSupportCreationScript (const char *projectName, CStdString &result, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateOidGenerationSupportDropScript (const char *projectName, CStdString &result, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateSelectNextOidSql (const char *projectName, CStdString &result, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual int | generateComment (const char *commentText, CStdString &commentSql, CStdString &warningsForUser, CStdString &errorForUser)=0 |
virtual const char * | getScriptStatementTerminator ()=0 |
virtual int | translateOrderByStatement (const char *src, CStdString &dest, CStdString &warningsForUser, CStdString &errorForUser)=0 |
All SQL statements needed by IOPC are generated through this interface. This keeps IOPC database vendor independent.
Examples how the statements returned by individual methods of this class can look like can be found in documentation of Oracle8iSqlStatements, for now the only implementation of this interface.
|
Returns recommended database column type for given C++ attribute type.
Implemented in Oracle8iSqlStatements. |
|
Checks whether user specified database column type is compatible with original C++ data type.
Implemented in Oracle8iSqlStatements. |
|
Returns given string
Typical implementation would return Implemented in Oracle8iSqlStatements. |
|
Returns CREATE TABLE SQL statement for given table information.
Implemented in Oracle8iSqlStatements. |
|
Returns CREATE VIEW SQL statement - creates view as a union of given sub-SELECTs.
Implemented in Oracle8iSqlStatements. |
|
Returns DROP TABLE SQL statement for given table.
Implemented in Oracle8iSqlStatements. |
|
Returns DROP VIEW SQL statement for given view.
Implemented in Oracle8iSqlStatements. |
|
Generates simple INSERT INTO SQL statement. Because no column names are given, values for all table columns must be specified.
Implemented in Oracle8iSqlStatements. |
|
Generates INSERT INTO SQL statement for inserting data through host programming language variables
Implemented in Oracle8iSqlStatements. |
|
Generates UPDATE SQL statement that updates data in specified row's columns of given table. The data will be later bound using host programming language variables.
Implemented in Oracle8iSqlStatements. |
|
Generates SELECT SQL statement.
Implemented in Oracle8iSqlStatements. |
|
Generates DELETE SQL statement.
Implemented in Oracle8iSqlStatements. |
|
Generates WHERE clause for a SQL statement joining given
Implemented in Oracle8iSqlStatements. |
|
Generates condition that tests whether the value in given column is equal to a value from given value set.
Implemented in Oracle8iSqlStatements. |
|
Generates condition that tests whether the value in given column is equal to the value of specified host variable.
Implemented in Oracle8iSqlStatements. |
|
Generates CREATE INDEX SQL statement for given parameters.
Implemented in Oracle8iSqlStatements. |
|
Generates DROP INDEX SQL statement for given index name.
Implemented in Oracle8iSqlStatements. |
|
Generates EXPLAIN PLAN SQL script for given SELECT statement. Most DB systems have a SQL statement for finding out, how given SELECT will be computed. In Oracle and DB/2 this statement starts with "EXPLAIN PLAN". In some systems more than one SQL statement is needed to get desired information. Therefore this function should return a script - sequence of SQL statements separated and terminated by statement terminator (usually ';' - see getScriptStatementTerminator()).
Implemented in Oracle8iSqlStatements. |
|
Generates SQL script that creates database structures (tables / sequences etc.) needed for OID generation (generateSelectNextOidSql()). OIDs have to be unique only inside one project. In some systems more than one SQL statement may be needed, that's why this function should return a script - sequence of SQL statements separated and terminated by statement terminator (usually ';' - see getScriptStatementTerminator()).
Implemented in Oracle8iSqlStatements. |
|
Generates SQL script that destroys database structures created by generateOidGenerationSupportCreationScript(). In some systems more than one SQL statement may be needed, that's why this function should return a script - sequence of SQL statements separated and terminated by statement terminator (usually ';' - see getScriptStatementTerminator()).
Implemented in Oracle8iSqlStatements. |
|
Generates SQL statement that gets next value of OID. Result of executing the statement should be fetching of one integer value (precisely OidType value) - the OID. OIDs have to be unique only inside one project.
Implemented in Oracle8iSqlStatements. |
|
Generates comment to be put into SQL script.
Implemented in Oracle8iSqlStatements. |
|
Returns string that should be placed after every SQL statement, if generating SQL script. Implemented in Oracle8iSqlStatements. |
|
Function that makes it possible to translate (simplified) SQL92 ORDER BY clause to vendor specific SQL. If the database support (simplified) SQL92 ORDER BY clauses, it can just return
Implemented in Oracle8iSqlStatements. |