pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Database function syntax for inserting records
2+ messages / 2 participants
[nested] [flat]

* Database function syntax for inserting records
@ 2003-03-04 00:34 Susan Hoddinott <susan@perth.dialix.com.au>
  2003-03-04 17:31 ` Re: Database function syntax for inserting records Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Susan Hoddinott @ 2003-03-04 00:34 UTC (permalink / raw)
  To: pgsql-sql

Hello,

I have created the following function:

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 ;



which seems to me to be consistent with the instructions given in the Reference manual.  However, when trying to create this function I receive the errors:

parser: parse error at or near ";"

parser: parse error at or near "orderinsert"

Can any one tell my what I am doing wrong as this seems to be exactly as specified in the Reference and Programmer manuals?



Regards

Attachments:

  Susan Hoddinott.vcf (application/octet-stream, 170B) download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Database function syntax for inserting records
  2003-03-04 00:34 Database function syntax for inserting records Susan Hoddinott <susan@perth.dialix.com.au>
@ 2003-03-04 17:31 ` Josh Berkus <josh@agliodbs.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Josh Berkus @ 2003-03-04 17:31 UTC (permalink / raw)
  To: Susan Hoddinott <susan@perth.dialix.com.au>; pgsql-sql

Susan,

> which seems to me to be consistent with the instructions given in the
> Reference manual.  However, when trying to create this function I receive
> the errors:
>
> parser: parse error at or near ";"
>
> parser: parse error at or near "orderinsert"

What version of Postgres are you using?   Create function syntax has changed 
through the various versions.

-- 
Josh Berkus
josh@agliodbs.com
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-03-04 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-04 00:34 Database function syntax for inserting records Susan Hoddinott <susan@perth.dialix.com.au>
2003-03-04 17:31 ` Josh Berkus <josh@agliodbs.com>

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