Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP PL/SQL (TABLE DATATYPE)
A copy of this was sent to "Sylvain" <sylb_at_microtec.net>
(if that email address didn't require changing)
On Wed, 2 Sep 1998 14:10:30 -0400, you wrote:
>
>Every time i assign null to my table to delete them i get an error like
>"Expression is wrong type..."
>
>Is there any other way to do this ?
>
>----------------------------------------------------------------------------
>--
>Oracle Version :
>
>Oracle7 Server Release 7.1.6.2.0 - Production Release
>PL/SQL Release 2.1.6.2.0 - Production
>
>----------------------------------------------------------------------------
>--
>Example from the book :
>
>DECLARE
> TYPE NumTabTyp IS TABLE OF NUMBER
>
> INDEX BY BINARY_INTEGER;
> sal_tab NumTabTyp;
>BEGIN
> /* Load salary table. */
> FOR i IN 1..50 LOOP
> sal_tab(i) := i;
> END LOOP;
> ...
> sal_tab := NULL; -- deletes sal_tab table <---- this line does'nt
>work for me ???
>
That would be a "typo"
To delete all elements from a table, you would code something like:
declare
type numtabtype is table of number index by binary_integer;
sal_tab numTabType;
emptyNumTab numTabType;
begin
....
sal_tab := emptyNumTab;
end;
/
you cannot set a table to NULL, you can however set it to an empty table...
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Sep 02 1998 - 16:08:50 CDT
![]() |
![]() |