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
Is foreign key mandatory?
Explain what is a column in a table?
What information is needed to connect sql*plus an oracle server?
what is uncommittable transactions? : Transact sql
What is the maximum number of rows in sql table?
Explain the savepoint statement.
What is prepared statement in sql?
In pl/sql, what is bulk binding, and when/how would it help performance?
Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.
Explain what is a database?
when MSQL8.0 is in market
What is type and rowtype in pl sql?
What is the difference between python and sql?
how does a local variable is defined using t-sql? : Transact sql
What are the types of queries in sql?