Skip to Main Content

SQL & PL/SQL

Function call with multiple values return

SynerdgyJan 16 2017 — edited Feb 5 2017

Hi everyone!  I have a requirement to enter user 's name in an HTML email from a table with multiple users( then of course send the email).  After reading here in the forum I was able to understand I need to create a "function" to pass the variable to the html text.  Success.  However now I need to send an individual email to each user with correct username from the function.  My html email works successfully using a loop but I am unable to insert User names for each individual email sent to user.  I hope this makes sense but I promise to elaborate if necessary. If there is an article out there please share.  Here is my current function I am using but I receive an error upon executing the function from the html procedure (PLS-00306: wrong number or types of arguments in call to 'EMAILDETAILSNAME'). Any help would be greatly appreciated.  Thank you.

create or replace function EMAILDETAILSNAME

( flname_in IN varchar2 )

RETURN varchar2

IS

   flname varchar2(150);

  

  cursor c1 is

   select FLNAME

   from email_test7 WHERE FLNAME = flname_in;       

BEGIN

  

   open c1;

   fetch c1 into flname;

  

   if c1%notfound then

   DBMS_OUTPUT.PUT_LINE ('No name found');

   end if;

  

   close c1;

  

   RETURN flname;

  

  

end;

This post has been answered by John Spencer on Jan 16 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2017
Added on Jan 16 2017
4 comments
485 views