|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Getting Error "String index out of range: -1" on simple insert statement
Hello,
I'm executing a simple insert statement (please see query below) using DB2 8. On AS400. Statement runs successfully if it doesn't find any rows to insert, it returns error "String index out of range: -1". I'm using iSeries navigator to connect to AS400. If anyone came across such issue and/or has any suggestion I'd appreciate it. Thanks in advance. Abhijit -- Query -- INSERT INTO CO_BAL_TYPE ( Company_ID, Balance_Type_ID, Orig_Bal_Type_ID, Description, created_time, created_by_user_ID, modify_by_user_ID, modify_time, deactivation_date, bal_subtype ) SELECT Company_ID, ( SELECT max(balance_type_iD)+1 FROM co_bal_type WHERE company_ID = t1.Company_ID ), Balance_Type_ID, 'DPA - ' || Description, timestamp(current date, current time), created_by_user_ID, modify_by_user_ID, timestamp(current date, current time), deactivation_date, 'DPA' FROM CO_BAL_TYPE t1 WHERE bal_subtype is null AND balance_type_ID > 0 AND NOT EXISTS ( SELECT 1 FROM CO_BAL_TYPE WHERE Company_ID=t1.Company_ID AND orig_bal_type_ID=t1.balance_type_ID AND bal_subtype = 'DPA' ); -- -- End of script |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Getting Error "String index out of range: -1" on simple insert statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|