Consultor Eletrônico



Kbase P153561: SQL: 'Internal error 2' executing an SQL DELETE FROM a VIEW statement
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/6/2010
Status: Verified

SYMPTOM(s):

SQL: 'Internal error 2' executing an SQL DELETE FROM a VIEW statement

Executing the statement using the OpenEdge JDBC drivers returns the error:
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-219901
[DataDirect][OpenEdge JDBC Driver][OpenEdge] Internal error 2 (A buffer other than the NLS system handle memory was not large enough) in SQL from subsystem NLS SERVICES function nlsSortKey called from pro_idxkey_t::ix_bld_key on . for . Save log for Progress technical support.

Executing the statement using the OpenEdge ODBC drivers returns the error:
Error: Internal error 2 (A buffer other than the NLS system handle memory was not large enough) in SQL from subsystem NLS SERVICES function nlsSortKey called from pro_idxkey_t::ix_bld_key on . for . Save log for Progress technical support. (State:S1000, Native Code: FFFCA503)

Executing the following SQL DELETE statement:
DELETE FROM yshanshi.si_cat_item
WHERE
si_cat_item.sa_company_nbr = 36533 AND
si_cat_item.si_area_cd_nbr = 701 AND
si_cat_item.si_exchg_nbr = 483 AND
si_cat_item.si_ln_nbr = 7000 AND
si_cat_item.si_acct_nbr = 800800 AND
si_cat_item.si_cat_id = 'TRS';
Where yshanshi.si_cat_item is an SQL VIEW created against one table.

FACT(s) (Environment):

SuSE Linux
OpenEdge 10.1C04 Service Pack

CAUSE:

Bug# OE00191724

CAUSE:

The DELETE statement can be used on table and view. If deleting from a view, it is actually deleting from the real target table (view created on). During deletion, we update the index list of the target table and also get the field list of the table. The field list has two uses for DELETE statement:
1. To determine which fields, if any, are array fields with word indexes on them.
2. To process any triggers on the table.

Based on both cases, it is the real target table's field list to be used. Currently, the field list is build from the view if deleting from a view, that caused mismatch with some index fields (non-array field is mistaken as an array field) and later caused problem when deleting the index.

FIX:

Upgrade to OpenEdge 10.2B or later.