Quick Pg/PLSQL question

From: "Matt Wagner" <mwagner(at)envex(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Quick Pg/PLSQL question
Date: 2002-09-28 03:28:57
Message-ID: KCEFIALOPJAEIDEHDBOAKEBJDBAA.mwagner@envex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hey everyone,

Trying to run a VERY simple function. I've read through the Programmer's
Manual over and over, and continue to receive errors. First, I ran the
following to add the language to the database:

createlang plpgsql test

I then load the function using:

\i test_func.sql

I then run the function by simply executing:

select test_func() as answer;

The function I'm trying to execute is:

------------------------------------------

CREATE OR REPLACE FUNCTION test_func() RETURNS INTEGER AS '

DECLARE

BEGIN

INSERT INTO transaction_summary VALUES (61, 1, "now", 0, 0, 0, 0);

RETURN 1;

END;
' LANGUAGE 'plpgsql';

------------------------------------------

Very simple function, but I continue to receive errors, because of the "now"
part. However, in the Programmer's Manual, it specifically uses "now" with
double quotes in a couple examples. When executing the function, I continue
receiving the following errors:

NOTICE: Error occurred while executing PL/pgSQL function test_func
NOTICE: line 4 at SQL statement
ERROR: Attribute 'now' not found

Any help would be greatly appreciated.

Thank you,
Matt Wagner

Envex Developments
Your CGI Script Specialists
http://www.envex.net/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Glen Baker 2002-09-28 03:42:05 Re: 7.0 -> 7.2 Migration (oops)
Previous Message Martijn van Oosterhout 2002-09-28 02:05:58 Re: query speed depends on lifetime of frozen db?