Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 587
  • Last Modified:

Oracle Function

Hi,
I have an PL/SQL function who need's to run every 15 minutes. The name of the function is UPDATE_RC_ITL, inserting the data from one to another database...
Thank you in advance
0
andrejaTJ
Asked:
andrejaTJ
1 Solution
 
Geert GruwezOracle dbaCommented:
you need db_link from the database with the destination table to the source database
http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_5005.htm#SQLRF01205

you can use dbms_scheduler for scheduling a procedure or pl/sql call every 15 minutes
http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_sched.htm#CIHHBGGI

the first time you'll need to create the table
create table xxx as select from schema.table_name@db_link;

and then add the changed data with the merge statement
http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_9016.htm#SQLRF01606
0
 
slightwv (䄆 Netminder) Commented:
Use dbms_scheduler to run the function.

This should work.  Just change the function name and name the job and comments whatever you want.
exec dbms_scheduler.create_job (job_name => 'SOME_JOB', -
	job_type => 'STORED_PROCEDURE', -
	job_action => 'myStoredFunction', -
	number_of_arguments => 0, -
	repeat_interval => 'FREQ=HOURLY; BYMINUTE=0,15,30,45; BYSECOND=0', -
	enabled => TRUE, -
	comments => 'My function');

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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