Simple PL/SQL coding advice needed.
I have a procedure to send an email (using UTL_SMTP) in the database.
The message body should be a list of records from a table.
What would be an efficient method for creating the message body?
I was thinking of declaring a char variable to hold the text and LOOPING through the table . For every record found it would append the 2 column char string to the string variable with a CHR(10) to throw a new line.
So (Pseudo code)
CURSOR C1 IS
SELECT colA||' - '||colB
WHERE x = y...;
OPEN c1 ...
FETCH INTO v_2_col_char_string;
Var_string := var_string||v_2_col_char_string||CHR(10);
THEN CALLING MY mail procedure:
SEND_MAIL(recipient, from, var_string ...);
Is there a more efficient or neater way of doing what I'm after?
Click Here to Expand Forum to Full Width