Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    8

    Unanswered: whats wrong with that?

    don't know why it won't work!
    would be glad if anybody could help!

    CREATE FUNCTION testy_b_i_f() RETURNS OPAQUE AS '
    BEGIN
    insert into "repChange"(tablename, action, stamp, recordsetid) values ('testy', 'insert', now(), 1);
    RETURN NEW;
    END;'
    LANGUAGE 'plpgsql';

    ERROR: parser: parse error at or near "testy"

    thx, mingy

  2. #2
    Join Date
    Dec 2002
    Posts
    15
    You need to escape the quotes for testy and insert (as the function definition itself is already in quotes) - the postgresql man has a page dedicated to this, as it can get confusing!

    CREATE FUNCTION testy_b_i_f() RETURNS OPAQUE AS '
    BEGIN
    insert into "repChange"(tablename, action, stamp, recordsetid) values (''testy'', ''insert'', now(), 1);
    RETURN NEW;
    END;'
    LANGUAGE 'plpgsql';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •