Обсуждение: help with error: "... is not a column in an inserted table"

Поиск
Список
Период
Сортировка

help with error: "... is not a column in an inserted table"

От
"Zeb Fropiaz"
Дата:
I am trying to update a field of a specific tuple. 'new_cid' is a short that
has been filled with some value before the following piece of code is
reached.

EXEC SQL UPDATE myuserid.spies
  SET country_id = new_cid // where country_id is the name of the field in
the schema
  WHERE CURRENT OF spies_cursor;

The cursor has been declared and opened properly. But this is the error I
get:


Error: "NEW_CID" is not a column in an inserted table, updated table, or any
table identified in a FROM clause or is not a valid transition variable for
the subject table of a trigger. SQLSTATE=42703

This seems to happen everytime I want to update something. Basically, I am
unable to store a C variable in a field of a tuple. How do I do that? I
could find example of updating a tuple using one of its own fields, i.e. say
field1 is a field of some tuple of type short int, and I go "field1 = field1
* 2" -- that works! But say I have a C variable foo and I go "field1 =
foo" -- this gives me the above type of error.

What am I doing wrong? Anyone!

Thanx