0

How can I make a variable subject of an email using PL/SQL?

Currently, I am using a constant string as the subject:

'Open Action items for review'

I need to modify it to:

'Open Action items for review Day 5'  -> If the action item is on 5th day since opening.

Or:

'Open Action items for review Day 10' -> If the action item is on 10th day since opening.

How can I accomplish this task?

Grant Miller
  • 27,532
  • 16
  • 147
  • 165
Amrita06
  • 1
  • 3

1 Answers1

0

Example Function:

CREATE OR REPLACE FUNCTION doit
    (days as VARCHAR2) 
RETURN VARCHAR2
IS
BEGIN 
    RETURN 'Open Action items for review Day ' || days;
END doit;

How to call:

BEGIN
    DBMS_OUTPUT.PUT_LINE('Subject: ' || doit(5));
END;
kara
  • 3,205
  • 4
  • 20
  • 34