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

Bill Erickson berick at esilibrary.com
Mon Feb 25 17:17:45 EST 2013


On Mon, Feb 25, 2013 at 4:04 PM, Larry W Arnold <arnold at wvlc.lib.wv.us>wrote:

> 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 $$
>
>
Hi Larry,

Try 'RETURNS VOID' instead of 'RETURNS NULL'.

-b

-- 
Bill Erickson
| Senior Software Developer
| phone: 877-OPEN-ILS (673-6457)
| email: berick at esilibrary.com
| web: http://esilibrary.com
| Equinox Software, Inc. / Your Library's Guide to Open Source
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20130225/a1cc0cd2/attachment.htm>


More information about the Open-ils-general mailing list