你上面写的不叫触发器,叫Job; DBMS_JOB.SUBMIT ( job OUT BINARY_INTEGER, what IN VARCHAR2, next_date IN DATE DEFAULT sysdate, interval IN VARCHAR2 DEFAULT 'null', no_parse IN BOOLEAN DEFAULT FALSE, instance IN BINARY_INTEGER DEFAULT any_instance, force IN BOOLEAN DEFAULT FALSE); ========================================================================= Parameter Description ========================================================================= job Number of the job being run.
what PL/SQL procedure to run.
next_date Next date when the job will be run.
interval Date function that calculates the next time to run the job. The default is NULL. This must evaluate to a either a future point in time or NULL.
no_parse A flag. The default is FALSE. If this is set to FALSE, then Oracle parses the procedure associated with the job. If this is set to TRUE, then Oracle parses the procedure associated with the job the first time that the job is run. For example, if you want to submit a job before you have created the tables associated with the job, then set this to TRUE.
instance When a job is submitted, specifies which instance can run the job.
force If this is TRUE, then any positive integer is acceptable as the job instance. If this is FALSE (the default), then the specified instance must be running; otherwise the routine raises an exception.
Trigger好像还没有这个功能吧 呵呵
charge1 binary_integer;
begin
dbms_Job.submit(charge1 ,'grade_com;',to_date('06-09-2004 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),'sysdate+1');
end;
那么,我应该在哪里运行我的这一段程序呢,把它写成一个触发器?我要的是按照系统时间,而不是每次我都手动执行啊?
DBMS_JOB.SUBMIT (
job OUT BINARY_INTEGER,
what IN VARCHAR2,
next_date IN DATE DEFAULT sysdate,
interval IN VARCHAR2 DEFAULT 'null',
no_parse IN BOOLEAN DEFAULT FALSE,
instance IN BINARY_INTEGER DEFAULT any_instance,
force IN BOOLEAN DEFAULT FALSE);
=========================================================================
Parameter Description
=========================================================================
job
Number of the job being run.
what
PL/SQL procedure to run.
next_date
Next date when the job will be run.
interval
Date function that calculates the next time to run the job. The default is NULL. This must evaluate to a either a future point in time or NULL.
no_parse
A flag. The default is FALSE. If this is set to FALSE, then Oracle parses the procedure associated with the job. If this is set to TRUE, then Oracle parses the procedure associated with the job the first time that the job is run. For example, if you want to submit a job before you have created the tables associated with the job, then set this to TRUE.
instance
When a job is submitted, specifies which instance can run the job.
force
If this is TRUE, then any positive integer is acceptable as the job instance. If this is FALSE (the default), then the specified instance must be running; otherwise the routine raises an exception.
你要是再不懂我也没办法了