Solved

Oracle Function

Posted on 2013-12-11
2
538 Views
Last Modified: 2013-12-16
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
Comment
Question by:andrejaTJ
2 Comments
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39711150
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
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 200 total points
ID: 39711153
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 improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

758 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

16 Experts available now in Live!

Get 1:1 Help Now