What is the outcome?

View the Exhibit and examine the structure of the SALGRADE table.


Examine the following code:


What is the outcome?
A. It is created successfully.
B. It gives an error because the return clause condition is invalid.
C. It gives an error because the usage of the host variables is invalid.
D. It gives an error because the data type of the return clause is invalid.

Download Printable PDF. VALID exam to help you PASS.

2 thoughts on “What is the outcome?

  1. However in anonymous plsql block using host variable is allowed:

    HR@XE > begin
    2 select e.salary into :sal_host from employees e where e.employee_id=100;
    3 end;
    4 /

    PL/SQL procedure successfully completed.

  2. Agree that correct answer is C.
    Verified using following code:

    variable sal_host number;

    create or replace function sal_ok return boolean as
    begin
    select e.salary into :sal_host from employees e where e.employee_id=100;
    return true;
    end;
    /

    Warning: Function created with compilation errors.

    HR@XE > show err;
    Errors for FUNCTION SAL_OK:

    LINE/COL ERROR
    ——– —————————————————————–
    3/22 PLS-00049: bad bind variable ‘SAL_HOST’

    Following should have been used instead:

    create or replace function sal_ok return boolean as
    sal_host number;
    begin
    select e.salary into sal_host from employees e where e.employee_id=100;
    return true;
    end;
    /

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.