If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Code for Emptying table inside a Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-04, 05:28
vipulgaba vipulgaba is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
Code for Emptying table inside a Stored Procedure

There is a way of deleting data from table (emptying table) in DB2, which is more effective than the normal delete statement. Below is the command for that:

import from nul: of del replace into <table_name>

I have to use this kind of delete command inside a stored procedure. Can somebody please help me out on the way to do this?
Reply With Quote
  #2 (permalink)  
Old 08-05-04, 09:24
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Import is not allowed in Stored Procedure. Only SQL is allowed with a few exceptions (see the SQL Reference section on "SQL Procedure Statement").

Andy
Reply With Quote
  #3 (permalink)  
Old 08-05-04, 14:30
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
you can use

alter table <table_name> activate not logged initially with empty table

mujeeb
Reply With Quote
  #4 (permalink)  
Old 08-05-04, 14:33
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
mujeeb,
Only if the table was created with the NOT LOGGED INITIALLY clause.
Andy
Reply With Quote
  #5 (permalink)  
Old 08-05-04, 14:36
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
thanks ARwinner.. that is very true.

mujeeb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On