Help needed -> ERROR: record arow has no field description

Поиск
Список
Период
Сортировка
От Justin Clift
Тема Help needed -> ERROR: record arow has no field description
Дата
Msg-id 3A9DAD09.E1FBBA50@bigpond.net.au
обсуждение исходный текст
Ответы Re: Help needed -> ERROR: record arow has no field description  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hi all,

I'm getting this error, which to me makes no sense.  Running PostgreSQL
7.0.3 on Mandrake 7.2 (compiled from source, not the rpms).

The code is in a pl/pgsql function I am writing and I can't see why it's
complaining.

This is the appropriate part of the code :

<general CREATE type header>
       arow            record;
<other declarations>
BEGIN
<other code here, which works>
FOR arow IN select transaction_payments.cashback from
transaction_payments, payment_types where        transaction_payments.payment_type = payment_types.idnum LOOP
textbuf:= text(arow.cashback);           textbuf := textcat(textbuf, ''  '');           insert into receipts
(receipt_num,data) values (trans_num,
 
textbuf);       END LOOP;

<general END type syntax>

From the PostgreSQL log file (debug is set to 2), I am getting : 

query: SELECT  transaction_payments.cashback from transaction_payments,
payment_types where transaction_payments.payment_type =
payment_types.idnum
ERROR:  record arow has no field description
DEBUG:  Last error occured while executing PL/pgSQL function
create_receiptp3
DEBUG:  line 105 at assignment
AbortCurrentTransaction

The "arow" record type variable is used quite a lot in previous FOR
loops in this function.  This is the first FOR loop in the function that
uses more than one table though.  I suspect this may have something to
do with it.

As far as I can tell, this SQL statement is valid.  Does anyone have any
ideas how to get this to work.  I have tried several variations, and the
mailing lists don't even have a reference for this error message.

Regards and best wishes,

Justin Clift
Database Administrator


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

Предыдущее
От: Andrew Perrin
Дата:
Сообщение: Re: create function w/indeterminate number of args?
Следующее
От: Jacek Zagorski
Дата:
Сообщение: Insert into VIEW ???