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
What is the purpose of the sql select top clause?
Can we use loop in sql?
What are all the different types of indexes?
What is mutating error?
a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution
Explain the difference between 'between' & 'and' operators in sql
Can there be more than one function with a similar name in a pl/sql block?
How does a self join work?
Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints
How do I copy a table in sql?
What is the usage of when clause in trigger?
How exception is different from error?
What is sql dialect?
What is the best free sql database?
What is the difference between database trigger and stored procedure?