• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 897
  • Last Modified:

[ORACLE]Stored procedure running PHP script

Hello,

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?
0
Caruso_eu
Asked:
Caruso_eu
  • 2
  • 2
2 Solutions
 
COBOLdinosaurCommented:
If you are running on linux, then you should be able to use CRON to run the PHP script on a schedule.

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

http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_sched.htm#ARPLS72260
0
 
Caruso_euAuthor Commented:
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?
0
 
slightwv (䄆 Netminder) Commented:
>>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.
0
 
Caruso_euAuthor Commented:
Ok thank you !
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now