This topic is locked

PHPRunner Enterprise DAL(Data Access Layer) script

2/1/2019 12:55:58 PM
PHPRunner General questions
J
jmartin17 author

I am using PHPRunner Enterprise 10.0 I am having trouble with DAL(Data Access Layer) connection to read from one System running AIX DB2 database to another system running Linux, MySQL with Databases having the same table and fields. I have searched for example but could not find any. In this code example I tried to read from a system running AIX DB2 database JMALIB table MDEBTOR and write to Linux, MySQL table mdebtor on another system. I want to read all the records from AIX DB2 database JMALIB table MDEBTOR and insert(add) them to the Linux, MySQL table mdebtor:



global $dal;

$table = $dal->Table("JMALIB.'MDEBTOR', 'JMALIB', 'ODBC:i270')");

$rs = $table->QueryAll();

while ($data = db_fetch_array($rs))

{

INSERT INTO mdebtor

$rs-Value["BRANCH"]=$values["BRANCH"];

$rs-Value["CLIENT"]=$values["CLIENT"];

$rs-Value["DEBTNO"]=$values["DEBTNO"];

$rs-Value["DNAME"]=$values["DNAME"];

$rs-Value["ADDR"]=$values["ADDR"];

$rs-Value["ADDR1"]=$values["ADDR1"];

$rs-Value["DCITY"]=$values["DCITY"];

$rs-Value["DSTATE"]=$values["DSTATE"];

$rs-Value["DZIP"]=$values["DZIP"];
}


I have created a new project in PHPRunner Enterprise and have the AIX DB2 database JMALIB table MDEBTOR

connected ODBC the Linux, MySQL table mdebtor is connected using URL on local network.
What is the proper syntax for the DAL(Data Access Layer) script?