I have a small PL/SQL Block
assume in this way
begin
select * from emp where empno=100;
exception
when others then
<Some Messages>
when no_data_found then
<Some Messages>
when too_many_rows then
<Some Messages>
end;

The question which he asked was whether this block will get
executed normally or it will throw error ?


If errored out then what is the reason for the error ?

Could anybody please help me ?
Regards
Nakul Venkataraman

Answer Posted / kavitha nedigunta

yes this will give error,
1.need to include the into clause.
(PLS-00428: an INTO clause is expected in this SELECT
statement)
2.as in exception block when others
should be at the bottom of the exception block.
(PLS-00370: OTHERS handler must be last among the exception
handlers of a block)

Is This Answer Correct ?    20 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we create table inside stored procedure?

534


How can you fetch first 5 characters of the string?

554


Show code of a cursor for loop.

584


How long will it take to learn pl sql?

525


Write a query to find the names of users that begin with "um" in sql?

507






how to get a list of all tables in a database? : Sql dba

513


What is the purpose of design view?

527


What is varray in pl sql?

566


what is index? : Sql dba

558


What is orm in sql?

541


What is the requirement of self-join?

546


Why stored procedure is faster than query?

519


Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

561


Explain select statements in sql?

591


Define implicit and explicit cursors.

632