[ORACLE]Stored procedure running PHP script

Posted on 2012-09-06
Last Modified: 2012-09-06

i am wondering if anyone have tried something similar. I have a PHP script which is fetching data of website and storing it in oracle. This has to be automated somehow.

So i was wondering if it would be possible to make database procedure and set up a JOB for it and make it run every X time.

I am running this PHP procedure from CMD on windows with following command:

php.exe name_of_script.php parameter1 parameter2

Oracle base 10.0.2 is installed on linux.

Any ideas?
Question by:Caruso_eu
    LVL 53

    Assisted Solution

    If you are running on linux, then you should be able to use CRON to run the PHP script on a schedule.

    LVL 76

    Expert Comment

    by:slightwv (䄆 Netminder)
    I agree that this should probably be scheduled outside the database but since you asked:  DBMS_SECHDULER can execute an OS program:

    Author Comment

    So its doable? I mean i would probably have to install PHP client on linux if i would want to run it with HOST command from my stored procedure?
    LVL 76

    Accepted Solution

    >>I mean i would probably have to install PHP client on linux

    ummm, yes.  To run PHP fro mthe database server it sort of has to be there.

    >>if i would want to run it with HOST command from my stored procedure?

    There is no HOST command in a stored procedure.  HOST is a sqlplus command.

    >>So its doable?

    Just about anything is doable.  The question is does it make sense to do it this way?

    Personally I would probably have whatever process places the file where you need it to trigger the processing of the file and not really schedule it at all.

    Author Comment

    Ok thank you !

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
    I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
    This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now