pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Schmitz <a.schmitz@cityweb.de>
To: Susan Hoddinott <susan@hexworx.com>
To: pgsql-sql@postgresql.org
Subject: Re: Create function statement with insert statement
Date: Fri, 14 Mar 2003 15:52:38 +0100
Message-ID: <200303141552.38325.a.schmitz@cityweb.de> (raw)
In-Reply-To: <003201c2e876$3498a880$1f84fea9@oemcomputer>
References: <003201c2e876$3498a880$1f84fea9@oemcomputer>


Hi Susan,

I had a similar problem with a function using pl/pgsql. I checked the docs 
(7.3) for it and discovered the following info:

"A trigger procedure is created with the CREATE FUNCTION command as a function 
with no arguments and a return type of OPAQUE"

http://www.postgresql.org/docs/view.php?version=7.2&idoc=1&file=plpgsql-trigger.html


Regards,

-Andreas




> 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

-- 
Andreas Schmitz - Phone +49 201 8501 318
Cityweb-Technik-Service-Gesellschaft mbH
Friedrichstr. 12 - Fax +49 201 8501 104
45128 Essen - email a.schmitz@cityweb.de




view thread (14+ messages)  latest in thread

Message-ID: <200303141552.38325.a.schmitz@cityweb.de>
Permalink:  ../200303141552.38325.a.schmitz@cityweb.de/
Also on:    postgresql.org/message-id/200303141552.38325.a.schmitz@cityweb.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: a.schmitz@cityweb.de, susan@hexworx.com
  Subject: Re: Create function statement with insert statement
  In-Reply-To: <200303141552.38325.a.schmitz@cityweb.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