INTEGRAL DSL Reference Guide
Jump directly to:
CDTDriverDB Class Members
The CDTDriverDB class provides access to external databases and contains the following members:
Constructor
- constructor(db_type = DB_DRIVER_POSTGRESQL) — Construct a new database driver object. Default is PostgreSQL.
Functions
- Connect(conn_str, flags = 0) — Connect to the database specified by the conn_str parameter.
- Exec(exec_str, type = DB_EXEC_COMMAND) — Execute a database command (i.e. an SQL statement) which is specified by the exec_str parameter and, depending on type, retrieve a dataset. Returns execution result or total number of rows in the dataset. Negative value indicates an error.
- Data(exec_str) — Execute a database command and retrieve the corresponding dataset. Returns total number of rows in the retrieved dataset. Same as Exec(exec_str, DB_EXEC_DATASET).
- GetRowCount() — Get the total number of rows in the retrieved dataset.
- GetColCount() — Get the total number of columns in the retrieved dataset.
- GetData(row = 0, col = 0) — Get data from the retrieved dataset. The row and col parameters specify the data cell in the dataset.
- GetLastError(flags = 0) — Get the last database error as a human readable string. Empty string means no error.
- Clear() — Clear last retrieved dataset. This function is called automatically by next Connect, Exec, Data or Disconnect.
- Disconnect()— Disconnect from the database. This function is called automatically by next Connect or when the destructor is invoked (i.e. when the CDTDriverDB object goes out of scope).
Properties
- const DB_DRIVER_POSTGRESQL = 0
- const DB_EXEC_COMMAND = 0
- const DB_EXEC_DATASET = 1