[OPEN-ILS-GENERAL] Syntax error when creating postgres function

Larry W Arnold arnold at wvlc.lib.wv.us
Mon Feb 25 16:04:48 EST 2013


Will someone please provide assistance or guidance on the problem I am
experiencing while attempting to create the postgres function for inserting
records into the evergreen database?

 

evergreen=# CREATE OR REPLACE FUNCTION staging_importer() RETURNS NULL AS $$

evergreen$# DECLARE stage RECORD;

evergreen$# BEGIN

evergreen$# FOR stage IN SELECT * FROM staging_records_import ORDER BY id
LOOP

evergreen$#       INSERT INTO biblio.record_entry (marc, last_xact_id)
VALUES (s

tage.marc, 'IMPORT');

evergreen$#       UPDATE staging_records_import SET dest =
currval('biblio.recor

d_entry_id_seq');

evergreen$#    END LOOP;

evergreen$#   END;

evergreen$#   $$ LANGUAGE plpgsql;

ERROR:  syntax error at or near "AS"

LINE 1: ...TE OR REPLACE FUNCTION staging_importer() RETURNS NULL AS $$

Thank You

Larry Arnold

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20130225/79d3b158/attachment-0001.htm>


More information about the Open-ils-general mailing list