I am trying to find out what is the best way of running a 6 meg sql script against an oracle database. I have a sql script that is ran every so often against some of are Oracle databases and I am wondering what is the best way to run this from php to oracle. Is there a better way than just creating hundreds of OCIExecute's, or is there a way I can have php just run a file.sql against the database.

Thanks

    To throw something else on the fire if there is a way to run a huge sql script is there a way to store the sql results such as (view created, table dropped and so on) in an array.

    thanks

      this sounds like a good place for a stored procedure...wouldn't it be easier and faster to create this as an SP? better overall performance as you don't need to send the entire script to the DB server each time, just the parameter values and the DB server does all the work...

        I thought about a stored procedure but the problem is we run this on about 20 production databases when needed and sometimes on individual laptops.

        I what everything to reside on php's side so all I have to do is know the ipaddress and database and I can connect and run the scripts.

          you're storing Dbs on a laptop?

          but any way you could just put the sp on each DB...or

          another option would be to create a COM component and access that in a central location and let it do all the work. Just call the COM object (be it C++, VB, Java) and let it go...reduces all the network traffic and get the server(s) to do the work...

            The reason we have oracle db's on laptops is because we demo apps and info to clients.

            I am trying to stay away from the stored procedure but I might have to. The reason I do not want anything on the client is because the script ran against the client's are different for each database.

            Well I guess this is going to be tougher than I thought.

            On another note I have a couple scripts with about 20 lines that I run and right now I just store them in an array and call them with a loop. Is there a better way to do?

            thanks

              Write a Reply...