logo

Crowdly

Browser

Add to Chrome

Consider this function: CREATE OR REPLACE FUNCTION get_employee_fullname...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Consider

this function:

CREATE

OR REPLACE FUNCTION get_employee_fullname (

    p_emp_id IN NUMBER

)

RETURN VARCHAR2

IS

    v_fullname VARCHAR2(200);

BEGIN

    SELECT first_name || '-' || last_name

    INTO  

v_fullname

    FROM  

HR.employees

    WHERE 

employee_id = p_emp_id;

 

    RETURN v_fullname;

 

EXCEPTION

    WHEN NO_DATA_FOUND THEN

        RAISE_APPLICATION_ERROR(-20001, 'Employee not found for ID: ' || p_emp_id);

 

    WHEN OTHERS THEN

        RAISE_APPLICATION_ERROR(-20002, 'Unexpected error in get_employee_fullname: ' || SQLERRM);

END;

/

employee_id

first_name

Last_name

email

hire_date

job_id

salary

100

Steven

King

SKING

6/17/2013,

12:00:00 AM

AD_PRES

24000

101

Neena

Yang

NYANG

9/21/2015,

12:00:00 AM

AD_VP

17000

102

Lex

Garcia

LGARCIA

1/13/2011,

12:00:00 AM

AD_VP

17000

103

Alexander

James

AJAMES

1/3/2016,

12:00:00 AM

IT_PROG

9000

What is the output of this program given above table:

DECLARE

    v_name VARCHAR2(200);

BEGIN

    v_name := get_employee_fullname(-1); 

    DBMS_OUTPUT.put_line('Name: ' || v_name);

END;

/

0%
0%
0%
100%
0%
More questions like this

Want instant access to all verified answers on moodle.uowplatform.edu.au?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome