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 > Insert/select on same table (no responses)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-08-05, 04:14
Regardt Regardt is offline
Registered User
 
Join Date: Feb 2005
Posts: 1
Insert/select on same table (no responses)

Hi all

I'm going a bit crazy, because I'm a new be in DB2 and the sql statement I'm
using don't do anything. I'm recieving no response from the DB2 command prompt. If I run the qeury for my application the error is [IBM][CLI Driver][DB2/NT] SQL0952N Processing was cancelled due to an interrupt. SQLSTATE=57014. I believe the reason for the error is the fact that my DB2 command object CommandTimeout expires.

I would appreciate it if anybody would have a look at the sql and adivise me on a better way or work around to solve the problem

Insert into tbl_BSC_Translation Select TRAN_CODE,'pl-PL ',TRAN_ENGLISH_DESC,TRAN_TRANSLATION,TRAN_USAGE_TY PE from tbl_BSC_Translation where
TRAN_CODE not in (Select TRAN_CODE from tbl_BSC_Translation where LANG_CODE = 'pl-PL ' with ur) and LANG_CODE = 'en-ZA

The query works prefictly in mssql.

Thanks Regardt

PS. The recored amount inserted by this query is +/- 200 000 rows.
Reply With Quote
  #2 (permalink)  
Old 02-08-05, 04:33
tkwlaw tkwlaw is offline
Registered User
 
Join Date: Feb 2005
Posts: 3
I think the return code SQL0952N means you have interrupt the process rather than time out. Have you press <Ctrl-C> to stop the process?

To test you SQL, may be you can fetch the first 1000 rows first by specifying 'SELECT xxxx WHERE xxx FETCH 1000 ROWS FIRST'.
Reply With Quote
  #3 (permalink)  
Old 02-08-05, 09:49
chavadb2 chavadb2 is offline
Registered User
 
Join Date: Aug 2004
Posts: 138
The insert after the select on the same table puts it in lockwait state unless you set TxnIsolation=1 at the client side in db2cli.ini or you use set current isolation level=UR. At the databse side if your db config parameter locktimeout is set to -1 the application will wait for ever. Your command might be getting timedout out waiting for the lock.
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