I have a very simple procdure that I want to run using dbms_job every, say, 30 sec. How would I accomplish it using dbms_job procedure. This is my procedure for printing name.
Code:
CREATE OR REPLACE PROCEDURE PRINT_NAME IS
BEGIN
DBMS_OUTPUT.PUT_LINE('MY NAME IS JOHNNY');
END;
I want to know how to submit this print_name procedure to my dbms_job. Thanks.
Thanks for the link, i found many like u gave me. I have trouble submitting my print_name procedure, if, by chance you read it my post.
I have this example, which runs fine.
Code:
jobno number;
begin
dbms_job.submit(:jobno,'declare
x number;
begin
select count(*) into x from dual;
end;',
sysdate );
end;
I am not sure how to submit my print_name and have my output. If someone can shed some light that would be great, no stupid replies ever appreciated. Thanks.
Originally posted by see_one
If someone can shed some light that would be great, no stupid replies ever appreciated. [/B]
Originally posted by marist89 WTF?
I appreciate stupid replies!!! Besides your a Super Genious, since when have you given a stupid reply outside of obfuscation unlimited? In any event you would think that see_one knows his name is Johnny by now! Why would he need Oracle to remind him every 5 seconds?
Code:
CREATE OR REPLACE PROCEDURE PRINT_NAME IS
BEGIN
DBMS_OUTPUT.PUT_LINE('MY NAME IS JOHNNY');
END;
see_one, you should either create a stored procedure using utl_file to log to a file or log to a table, or you should just create a cron job calling a stored procedure and redirect the output.
My DBA tells me DBMS_OUTPUT.PUT_LINE output is not retrievable when using DBMS_JOB to run stored Procedures that trap EXCEPTIONs and produce information using PUT_LINE.
dont use dbms_output - its only use is printing debug information to screen - no good in jobs (or even in normal procedures) Where would you expect the output to go when a job runs?
Write lines out to a text file or insert into a table
Bookmarks