The IDL DataMiner provides two IDL objects for accessing databases:
The Database object contains instance data and methods that you can use to connect to, disconnect from, and perform operations on a DBMS. The Recordset object contains a database table or the results from a SQL query. You can use Recordset methods to manipulate table data.
Note: Some of the methods associated with IDL database and recordset objects are driver- dependent. This means that some functions are not available when you are using database drivers that do not support those functions.
The IDL DataMiner also provides the following IDL functions:
- DIALOG_DBCONNECT : Use this function to connect to the DBMS via the standard ODBC dialog boxes. This method prompts you for any information that is required to connect to the desired database.
-
DB_EXISTS: Use this function to determine if database functionality is available and licensed on a specific platform. The ODBC system is not available on all systems. Use the DB_EXISTS function to determine if a database is available and licensed on your system.
To check whether ODBC is available on your system, enter the following at the IDL prompt:
status = DB_EXISTS()
If IDL DataMiner and ODBC drivers are installed on your system and the DataMiner option is properly licensed, the DB_EXISTS function returns 1; otherwise the function returns 0.
Using the DB_EXISTS Function
The ODBC system is not available on all systems. Use the DB_EXISTS function to determine if a database is available and licensed on your system. To check whether ODBC is available on your system, enter the following at the IDL prompt:
status = DB_EXISTS()
If IDL DataMiner and ODBC drivers are installed on your system and the DataMiner option is properly licensed, the DB_EXISTS function returns 1; otherwise the function returns 0.
Data Type Mappings
SQL data types have been mapped to IDL DataMiner data types so that you can access and manipulate the data without having to fully understand SQL. The table below details these mappings.
IDL Type |
SQL Type |
STRING |
DECIMAL
NUMERIC
CHAR
LONG VARCHAR |
BYTE |
BIT
TINYINT
BIGINT |
INT |
SMALLINT |
LONG |
INTEGER |
LONG64 |
BIGINT |
FLOAT |
REAL |
DOUBLE |
FLOAT
DOUBLE PRECISION
|
BYTE ARRAY |
BINARY
VARBINRY
VARCHAR
LONG VARBINARY |
ODBC_SQL_DATE Struct
|
DATE |
ODBC_SQL_TIME Struct
|
TIME |
ODBC_SQL_TIMESTAMP Struct
|
TIMESTAMP |