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 / sdp
Yes , it will give an error as for single row queries we
need to include the into clause also
the query would be
declare
v_emp emp%rowtype%;
begin
select * into v_emp from emp where empno=100;
exception
---
---
end;
| Is This Answer Correct ? | 5 Yes | 8 No |
Post New Answer View All Answers
how to include numeric values in sql statements? : Sql dba
What does the argument [or replace] do?
How do you get column names only for a table (sql server)?
what are all the different normalizations? : Sql dba
how would you get the current date in mysql? : Sql dba
How subquery works in sql?
What is a boolean in sql?
What is nosql vs sql?
How to rename a column in the output of sql query?
what is cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure
What sql database should I use?
Should I use mbr or gpt?
What is materialized view in sql?
What is the use of & in pl sql?
what is innodb? : Sql dba