Transaction object to data source mapping can be dynamically set up or changed by setting or changing the DBMS and DBParm properties of the Transaction object in the application source code.
To set or change the data source dynamically, code the DBParm property of the Transaction object in this format:
SQLCA.DBParm="CacheName='ASADataSource1'"
"ASADataSource1" can be replaced by the name of the data source you want to use for the Transaction object.
To set or change the database type dynamically, code the DBMS property of the Transaction object using this format:
SQLCA.DBMS = "ODB-ASA"
The value of the DBMS property should be set based on the database type; refer to the table below.
Table 21. Setting the DBMS property based on the database type
Database Type |
ODBC Interface |
JDBC Interface |
OLE Interface |
Native Interface |
---|---|---|---|---|
MS SQL Server |
ODB-MSS |
JDB-MSS |
OLE-MSS |
MSS |
Oracle 11g/12c |
ODB-O10 |
JDB-O10 |
OLE-O10 |
O10 |
Oracle 18c/19c |
- |
- |
- |
ORA |
SAP ASE |
ODB-SYC |
JDB-SYC |
OLE-SYC |
SYC |
SAP SQL Anywhere |
ODB-ASA |
JDB-ASA |
OLE-ASA |
- |
IBM DB2 UDB |
ODB-DB2 |
JDB-DB2 |
OLE-DB2 |
DB2 |
Informix |
ODB-IN9 |
JDB-IN9 |
OLE-IN9 |
IN9 |
MySQL |
ODB-MYS |
JDB-MYS |
- |
- |
Teradata |
ODB-TER |
JDB-TER |
- |
- |
PostgreSQL |
ODB-PGS |
JDB-PGS |
OLE-PGS |
PGS |
In the table above:
-
The names are not case-sensitive (for example: ODBC is the same as odbc).
-
If ODB or ODBC is set as the DBMS property, PowerServer will regard the database type as SAP SQL Anywhere. The "odb-asa" and "odb-db2" are Appeon defined values. They can be recognized by Appeon without affecting the running of the PowerBuilder application, because only the first three letters of the DBMS setting are valid in PowerScript syntax.