1 Reply Latest reply: Mar 9, 2012 10:32 AM by Pnauduri-Oracle RSS

    How to insert data into Oracle db from MySQL db through PHP?

    917080
      Hi,

      I want to insert my MySQL data into Oracle database through PHP.
      I can access Mysql database using mysql_conect() & Oracle database using oci_connect() through PHP.
      Now How can I insert my data which is in MySQL into Oracle table. Both table structure are exactly same.
      So I can use
      insert into Oracle_Table(Oracle_columns....) values(Select * from MySQL_Table);
      But again problem is I can't open both connections at the same time.

      So has anyone done this before or anyone having any other idea..

      Plz guide me...
        • 1. Re: How to insert data into Oracle db from MySQL db through PHP?
          Pnauduri-Oracle
          You can do it if you setup a ODBC Gateway between MYSQL and Oracle DB. Then you can directly read from MySQL table using DB links and insert into Oracle table in one single SQL Statement.

          Otherwise you need to fetch the data from MySQL Into variables in your PHP Program and then insert into Oracle after binding the variables to the insert statement for Oracle. Hope that is clear enough.

          Regards

          Prakash