Oracle database applications
- Last UpdatedJun 17, 2024
- 2 minute read
To establish communication between SQL Access and an Oracle database, you must connect to it by running a script containing the SQLConnect() function.
Communicate with an Oracle 8.0 database
-
Verify the Oracle OLEDB Provider (MSDAORA.DLL) file is installed on the computer running InTouch. This file is installed by MDAC, which is installed when you install InTouch.
-
Connect to Oracle by executing the SQLConnect() function in an InTouch action script.
The connection string used by the SQLConnect() function is formatted as follows:
SQLConnect(ConnectionId,"<attribute>=<value>;
<attribute>=<value>;...");
The following table describes the function attributes used by Oracle:
|
Attribute |
Value |
|---|---|
|
Provider |
MSDAORA |
|
User ID |
User name |
|
Password |
Password |
|
Data Source |
Oracle Server machine name |
SQLConnect(ConnectionId, "Provider=MSDAORA; Data Source=OracleServer; User ID=SCOTT; Password=TIGER;");
The following table lists the valid data types that SQL Access Manager supports for an Oracle database.
|
Data Type |
Length |
Default |
Range |
Tag Type |
|---|---|---|---|---|
|
char |
2,000 characters |
1 character |
Message |
|
|
number |
38 digits |
38 digits |
Integer |
To log the date and time to an Oracle 8.0 date field, you must configure the bind list using the delim() function.
Log both date and time to an Oracle date field
-
In the Application Explorer under SQL Access Manager, double-select Bind List. The Bind List Configuration dialog box appears.
-
In the Tagname.FieldName box, type the tag that you want to use. For example, DATE_TIME_TAG.
-
In the Column Name box, type the name of the Oracle date field. If you are using Oracle 8.0, use the delim() function to specify any delimiters. The delim() function is not required if you are using Oracle 9.2 or later.
-
In your InTouch application, create a QuickScript to prepare input data from present date and time. For example:
DATE_TIME_TAG = "TO_DATE('" + $DateString + " " + StringMid($TimeString,1,8) + "','mm/dd/yy hh24:mi:ss')";
After the QuickScript runs in WindowViewer, the date appears in the following format:
TO_DATE('08/22/06 23:32:18' ,'mm/dd/yy hh24:mi:ss')