Field name - Mailing list pgsql-general

From roy_
Subject Field name
Date
Msg-id 9jgres$lc3$1@news.tpi.pl
Whole thread Raw
List 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
*/

pgsql-general by date:

Previous
From: wsheldah@lexmark.com
Date:
Subject: Re: Microsoft SQL Server Replication
Next
From: "Dalibor Andzakovic"
Date:
Subject: databse design tools