Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: TRUNCATE from a stored procedure?
rollman_at_one.net says...
>
>I have users who need to reload several large tables on a weekly basis.
>Currently, they truncate
>each
> table and then run SQL* LOAD to load the new data. Apparently, doing a
>delete in a loop
>
>takes too
> long. I'm trying to find a way to take the schema owner's password
away
>from them,
>without slowing
> down
> their reloads too much.
>
>I know that I can't directly put a TRUNCATE command in a stored
procedure,
>since it's a DDL
>command,
> but several people have told me that there is an indirect way of
calling
>TRUNCATE
>from a stored
> procedure. However none of them can remember the details of how it is
>done.
>If anyone can tell me
> how this might be accomplished, I'd appreciate it.
>
>
>If it makes a difference, the databases are versions 7.2 and 7.3.
>
>Please post the answer to the newsgroup, or Email me at:
alan.kilivry_at_msx.ae
>.ge.com
>
>Thanks!
>
>
Since you are reloading the data using the SQL*Loader, why not use the SQL*Loader's Truncate option? This will truncate the table as part of the load and should solve your problem without having to make any stored procedure calls.
Hope this helps
Dan King Received on Mon Jun 02 1997 - 00:00:00 CDT