Skip site navigation (1) Skip section navigation (2)

where is this problem (trigger)

From: Theodore Petrosky <tedpet5(at)yahoo(dot)com>
To: postgres SQL <pgsql-sql(at)postgresql(dot)org>
Subject: where is this problem (trigger)
Date: 2004-05-12 17:57:50
Message-ID: (view raw or whole thread)
Lists: pgsql-sql
I fire this trigger whenever my client updates a row
in the db:

CREATE FUNCTION notify_jobinfo() RETURNS "trigger"
    AS '
EXECUTE ''NOTIFY ''||TG_RELNAME||''_''||NEW.jobnumber;
    LANGUAGE plpgsql;

CREATE TRIGGER notify_jobinfo
    AFTER UPDATE ON jobinfo
    EXECUTE PROCEDURE notify_jobinfo();

CREATE TABLE jobinfo (
    acode text,
    jobnumber text DEFAULT
    creationdate date DEFAULT now(),
    shortdescription text,
    projectcode text,
    holdnumber text,
    insertioninfo text,
    jobtitle text,
    insertiondate text,
    iscomplete boolean DEFAULT false,
    isbilled boolean DEFAULT false,
    CONSTRAINT "$1" CHECK ((jobnumber <> ''::text))

My problem is that I have had to import legacy data
for the jobnumber column. My client was originally
using an excel file.  they were free to do as they
pleased and there are jobnumbers like '1041.01'

I can not seem to update these rows because of the dot
in the jobnumber field. I have found that I can change
the dot to an underscore but I thought I would ask if
there is a better solution.

here is the error:

UPDATE jobinfo SET isbilled = false WHERE jobnumber =
ERROR:  syntax error at or near ".01" at character 20
CONTEXT:  PL/pgSQL function "notify_jobinfo" line 2 at
execute statement


Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2' 


pgsql-sql by date

Next:From: Bruno Wolff IIIDate: 2004-05-12 18:16:20
Subject: Re: How do i extract a certain bit from a bigint column
Previous:From: Gary StainburnDate: 2004-05-12 14:06:35
Subject: solved Re: view problem - too many rows out

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group