Consultor Eletrônico



Kbase 15192: S/e 3782 on FIND triggers referencing omitted columns SQL
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
S/e 3782 on FIND triggers referencing omitted columns SQL

Key words
Error #3782
Field Lists
SQL and Triggers

Summary

FIND triggers that reference columns not included in a
SQL query suffer run-time error 3782.

Explanation

In Version 8, PROGRESS SQL uses field lists to improve
client-server performance. Any column referenced in the SQL
query is included inthe field list.

If a field is referenced in a find trigger that does not
appear in the SQL SELECT statement, then error 3782 may
result. For example, the following code:

/* test.p */
ON FIND OF customer DO:
IF customer.name BEGINS "b" THEN RETURN ERROR.
END.

SELECT customer.cust-num FROM customer.

will result in the error:

Error "Field 3 from _sqlbuf5 record (record 6944) was
missing from FIELDS phrase (3782)"

Here, the customer.name field does not appear in the SELECT
statement and therefore is not present in the field list
used to resolve the query. As a result, the field is not
present at the time the find trigger is fired and the error
occurs.
There are a number of workarounds:

1) Use the -fldisable startup parameter to disable field
lists 2) Include the fields in the find trigger in the
query itself (such as SELECT name,cust-num FROM
customer or the query SELECT cust-num FROM customer
where name = name). 3) rethink the usage of the find
trigger.


Progress Software Technical Support Note # 15192