pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
Cc: susan@hexworx.com
Subject: Re: Create function statement with insert statement
Date: Thu, 13 Mar 2003 11:07:45 +0100
Message-ID: <3E705871.E0CBB9E@rodos.fzk.de> (raw)

>
> I am trying to create a database trigger which inserts into a second
table.=
>   I have created the following function in accordance with the
reference ma=
> nual documentation (7.2).=20=20
>
> CREATE OR REPLACE FUNCTION orderinsert(INTEGER, VARCHAR) RETURNS
INTEGER AS=
>  '
> INSERT INTO HEXORDERS ( CUSTOMER_ID, ORDER_KEY, DISTRIBUTOR_ID,
ORDER_AMOUN=
> T, ORDER_GST ) VALUES ( $1, $2, 1, 0, 0 ) ;
>
> SELECT 1 ;
>
> ' LANGUAGE SQL ;
>
> It fails with the cryptic error "parse error at or near ;".   Can
anyone te=
> ll me what is wrong with this syntax?
>
I cannot see anything wrong with this syntax, except the newline in
ORDER_AMOUN\nT. But this is probably originated from your
mailing tool, isn't it?
Could you provide us with the CREATE TABLE HEXORDERS ( ... );
statement? Did you try the INSERT command within psql?

Regards, Christoph





view thread (14+ messages)  latest in thread

Message-ID: <3E705871.E0CBB9E@rodos.fzk.de>
Permalink:  ../3E705871.E0CBB9E@rodos.fzk.de/
Also on:    postgresql.org/message-id/3E705871.E0CBB9E@rodos.fzk.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ch@rodos.fzk.de, susan@hexworx.com
  Subject: Re: Create function statement with insert statement
  In-Reply-To: <3E705871.E0CBB9E@rodos.fzk.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox