-1

I'm writing a stored function called MAKE_EMAIL that will accept input arguments for first name and lastname and will return a varchar2 value containing the email address in the form of first initial of the firstname followed by the full last name followed by @hpu.edu.

Ex: Calling select make_email('Edward','Souza') from dual would return the single value: esouza@hpu.edu

Here is my code:

create or replace function MAKE_EMAIL(lastname varchar2(10),firstname varchar(10))
return VARCHAR IS

f_name VARCHAR;
l_name VARCHAR;

BEGIN

RETURN 
END MAKE_EMAIL;
/

Could anyone please help me how to achieve the goal? I'm new in PL/SQL.

4

1 回答 1

1

尝试这个

create or replace function MAKE_EMAIL(lastname varchar2(10),firstname varchar2(10))
 return VARCHAR 
IS

      email VARCHAR2;

 BEGIN

 email := substr(lastname ,1,1)|| firstname || '@hpu.edu';
RETURN email;

END;
于 2013-05-06T10:02:10.450 回答