pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Susan Hoddinott <susan@hexworx.com>
To: Ian Harding <ianh@tpchd.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Create function statement with insert statement
Date: Fri, 14 Mar 2003 22:28:46 +0800
Message-ID: <022001c2ea36$072b3180$1f84fea9@oemcomputer> (raw)
References: <se70295c.026@mail.tpchd.org>

Unfortunately this did not solve the problem (I tried both upper and lower
case).  It is a strange one.  I end up with the following 3 errors:

ERROR: parser: parse error at or near "1"
ERROR: parser: parse error at or near ";"
ERROR: parser: parse error at or near "orderinsert"

Regards

----- Original Message -----
From: "Ian Harding" <ianh@tpchd.org>
To: <jong@e88.org>; <susan@hexworx.com>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, March 13, 2003 10:45 PM
Subject: Re: [SQL] Create function statement with insert statement


> I think the language needs to be in quotes ...
>
> ...
> ' language 'sql';
>
> >>> "Jon Griffin" <jong@e88.org> 03/12/03 11:59AM >>>
> You need to put your aliases in:
> value1 alias for $1;
> etc.
>
>  Hello,
> >
> > 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 manual documentation (7.2).
> >
> >
> > CREATE OR REPLACE FUNCTION orderinsert(INTEGER, VARCHAR) RETURNS INTEGER
> > AS '
> >
> > INSERT INTO HEXORDERS ( CUSTOMER_ID, ORDER_KEY, DISTRIBUTOR_ID,
> > ORDER_AMOUNT, 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
> > tell me what is wrong with this syntax?
> >
> > Regards
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster




view thread (14+ messages)  latest in thread

Message-ID: <022001c2ea36$072b3180$1f84fea9@oemcomputer>
Permalink:  ../022001c2ea36$072b3180$1f84fea9@oemcomputer/
Also on:    postgresql.org/message-id/022001c2ea36$072b3180$1f84fea9@oemcomputer

 · 

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: susan@hexworx.com, ianh@tpchd.org
  Subject: Re: Create function statement with insert statement
  In-Reply-To: <022001c2ea36$072b3180$1f84fea9@oemcomputer>

* 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