I'm trying to create a trigger to update the row just written to
a table. I'm having difficulties because it cannot resolve the
correlation of the variables. The example only has one of 4 columns
that I need to update.
Here is the entire code for the trigger:
Create trigger needles.WBXMLDtg01
after insert on needles.WBXMLD
referencing new row as new_row
for each row
set wbxtsp = now()
where wbxprc = new_row.wbxprc
this is the error:
SQL State: 42703
Vendor Code: -206
Message: [SQL0206] Column or global variable WBXPRC not found.
Cause: WBXPRC was not found as a column of table *N in *N
and was not found as a global variable in *N. If the table
is *N, WBXPRC is not a column of any table or view that can
be referenced. Recovery . . . : <<SNIP>>
-- If the column was intended to be a correlated reference,
qualify the column with the correct table designator. <<SNIP>>
Why can't WBXPRC be found? It is the key for the table and as such
exists in needles.WBXMLD. It is also identified using the
referencing name for the new row, new_row.
<ed: addendum from a followup reply>
BTW - the WBXPRC that is qualified with new_row (new_row.wbxprc)
seems to be the indicated part in error.
My experience with triggers is very low and after spending much of
the day looking online and in many manuals, I'm stuck.
This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact