referencing an attribute of a ROWTYPE variable in pgpsql using quote_ident or quote_literal

From: "David Monarchi" <david(dot)e(dot)monarchi(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: referencing an attribute of a ROWTYPE variable in pgpsql using quote_ident or quote_literal
Date: 2007-05-30 20:25:23
Message-ID: eea51fdb0705301325x4ed2b342ib01c7529f3d6a41c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello -

I'm using PG 8.2. I have the following code snippet:

adServerLoadRow domain2_dom%ROWTYPE;
attName text;
line text;
i int;

i = 3;
attName := split_part(line,E'\t',i);
adServerLoadRow.quote_literal(attName) = split_part(line,'\t',i+1);

The error message I receive is
ERROR: row "adserverloadrow" has no field "quote_literal"
SQL state: 42703
Context: compile of PL/pgSQL function "adserverfunctionbody" near line 57

I'm trying to dynamically assign values to attributes in a record without
know which attribute values I will actually receive. I will always receive
at least two key-value pairs with the elements separated by tabs.

I have tried both quote_literal and quote_ident with the same result. Any
advice or suggestions would be much appreciated.

Thank you.

David

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-05-30 21:51:23 Re: referencing an attribute of a ROWTYPE variable in pgpsql using quote_ident or quote_literal
Previous Message Michael Swierczek 2007-05-29 18:06:23 Re: problems with SELECT query results