Hi,
I am currently converting from Oracle to DB2, and ran into a problem. With Oracle, I could connect to host/port/db dynamically using:
$host = 'remoteHost';
$port = '9999';
$dbName = 'myDb';
$username = 'myname';
$password = 'mypassword';
$tns = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = " . $host . ") (PORT = " . $port . ")) (CONNECT_DATA = (SERVICE_NAME = " . $dbName . ")))";
$dbConn = OCIPLogon($username, $password, $tns);
How can this be done with DB2?
I understand that for DB2, we use odbc_pconnect(),
but how can I specify the host/port/dbName dynamically?
Thanks in advance.
--David.