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

Поиск
Список
Период
Сортировка
От Zeb Fropiaz
Тема help with error: "... is not a column in an inserted table"
Дата
Msg-id WjA09.216077$WJf1.122114@news01.bloor.is.net.cable.rogers.com
обсуждение исходный текст
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Nelson Marisco
Дата:
Сообщение: Inquiry From Form [pgsql]
Следующее
От: Al Arduengo
Дата:
Сообщение: Re: Postgres and Perl: Which DBI module?