Field name

From: roy_ <gprzezdz(at)elektron(dot)elka(dot)pw(dot)edu(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: Field name
Date: 2001-07-23 09:40:42
Message-ID: 9jgres$lc3$1@news.tpi.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Welcome.

Here is the problem (one of my friends)

create function remove_picture()
RETURNS OPAQUE AS '
DECLARE
field_name TEXT;
BEGIN
field_name := TG_ARGV[0];
DELETE FROM picture WHERE picture_id=OLD.field_name;
RETURN OLD;
END;
'

He needs create universal function for many tables to remowe record
(dont want to use references (FK))
create sql statment
DELETE FROM picture WHERE picture_id=OLD.field_name;

field_name is field name not the same name for this tables.
DELETE FROM picture WHERE picture_id=OLD.'field_name';

Sorry for my english

Best Regareds

--
/*
Kto nie pyta ten błądzi.
Kto pyta ten błądzi z innymi
*/

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2001-07-23 10:15:55 Re: psql on red hat 7.1
Previous Message Stephen Robert Norris 2001-07-23 08:59:55 Re: Hangs with 7.1.2 and vacuum