Home » SQL & PL/SQL » SQL & PL/SQL » Handing null nested table
Handing null nested table [message #191446] Wed, 06 September 2006 07:01 Go to next message
gauravpuri
Messages: 26
Registered: August 2005
Location: Chennai
Junior Member

hi

select * bulk collect into tab1
from emp
where empno=100;

there is no record for this employee number.

for 1 in tab1.first..tabl.last loop

--gives numeric or chracter err.

if i insert empno=100 into emp table then there is no err.

how to handle empty nested table.
Re: Handing null nested table [message #191447 is a reply to message #191446] Wed, 06 September 2006 07:02 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
nest it in an if-then construction in which you test that the count > 0.
Re: Handing null nested table [message #191454 is a reply to message #191447] Wed, 06 September 2006 07:18 Go to previous message
gauravpuri
Messages: 26
Registered: August 2005
Location: Chennai
Junior Member

thanks
Previous Topic: Using cursors and ref cursors
Next Topic: Call a function with parameters passed as a XML
Goto Forum:
  


Current Time: Mon Dec 05 10:55:44 CST 2016

Total time taken to generate the page: 0.10780 seconds