Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Howto Pass multiple parameters in DBMS_JOB.SUBMIT

oramanDec 19 2011 — edited Dec 19 2011
Hi all,

I have a dbms_job from which I would like to call a procedure with multiple parameters (variables and string parameters as well)

I'm not able to parse the values.

(I use dbms_job inside of a trigger to avoid firering the trigger before commit occurs)



CREATE OR REPLACE TRIGGER mytrigger
AFTER insert
ON mytable
FOR EACH ROW
DECLARE
to_email varchar2(255);
v_job number;
BEGIN
select email into to_email from mytable_2 where m_id = :NEW.m_id;

DBMS_JOB.submit
(
v_job,
'myprocedure( '||''from@email.com''||','||to_email||','||''my subject''||','||''This is the test message from oracle server''||');',
sysdate
);

END;
/

I use Oracle 11g.
all the parameters except to_email (variable) are strings. What is the right way to parse it?
any help would be appreciated!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2012
Added on Dec 19 2011
11 comments
1,380 views