error using pl/pgsql? [possibly off topic] - Mailing list pgsql-general

From Johnny Jørgensen
Subject error using pl/pgsql? [possibly off topic]
Date
Msg-id 200111231216310708.00868AE2@mail.halfahead.dk
Whole thread Raw
Responses Re: error using pl/pgsql? [possibly off topic]
List pgsql-general
I'm not sure if this is the place to get help on specific questions, but I'll give it a go..
 
I have a problem with this function:
 
CREATE FUNCTION new_order(text,text)
RETURNS text
AS '
 DECLARE
  p_id ALIAS FOR $1;
  p_date ALIAS FOR $2;
  ret_val text;
 BEGIN
  BEGIN WORK;
   INSERT INTO ordre (person_id,placement_date,status) VALUES (p_id::int4,p_date::decimal,1);
   SELECT currval(ordre_id_seq::text) INTO ret_val;
  COMMIT WORK;
  RETURN ret_val;
 END;
'
LANGUAGE 'plpgsql';
 
- I can create it, but when i run it, I get:
 
NOTICE: plpgsql: ERROR during compile of new_order near line 12
ERROR: parse error at or near ""
 
- the error message not being very informative, I've stared blindly at the script for an hour, messed with it, but i'm not really getting anywhere :/
 
If anyone can point me to my probably embarassingly obvious error, i'd be grateful.
Also, i'd appreciate some pointers to resources on plpgsql -i've got Momjian's book, and "Beginning databases with postgresql" (Stones, Matthew), but they each devote some 10 pages to plpgsql, and i'd love to get around a bit more?
 
thanks,
 
 
 
 

Johnny J�rgensen
 
+45 6315 7328

pgsql-general by date:

Previous
From: Gabriel Fernandez
Date:
Subject: Is the list working ok ?
Next
From: Nikola Milutinovic
Date:
Subject: Classes (Object Oriented) in PostgreSQL question