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

Reply via email to