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

Larry W Arnold arnold at wvlc.lib.wv.us
Mon Feb 25 17:29:52 EST 2013


Hi Bill,

 

That did it!!  I owe you a beer - Larry

 

 

From: open-ils-general-bounces at list.georgialibraries.org
[mailto:open-ils-general-bounces at list.georgialibraries.org] On Behalf Of
Bill Erickson
Sent: Monday, February 25, 2013 5:18 PM
To: Evergreen Discussion Group
Subject: Re: [OPEN-ILS-GENERAL] Syntax error when creating postgres function

 

 

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/427c4576/attachment.htm>


More information about the Open-ils-general mailing list