From: Josh Berkus <josh@agliodbs.com>
To: Oleg Lebedev <olebedev@waterford.org>
To: pgsql-sql@postgresql.org
Subject: Re: Calling Functions
Date: Mon, 01 Oct 2001 21:16:33 -0700
Message-ID: <web-129183@davinci.ethosmedia.com> (raw)
In-Reply-To: <3BB90E21.F8E6CE80@waterford.org>
Oleg,
> Hi,
> this is a very silly question, but how do I run PL/pgSQL function
> from SQL?
> I created a function test(varchar, varchar) and I am trying to invoke
> it with
> parameters 'hello', 'world' using an SQL statement. I tried selects
> and executes
> - nothing works.
> Please help,
SELECT test('hello','world');
If you aren't getting the result you expect, then you have made a
mistake in your function name, parameters, return type, or a syntax
error in the function itself.
For example, if you do in fact have the function:
CREATE FUNCTION test (VARCHAR, VARCHAR) RETURNS VARCHAR AS '
DECLARE ....
And if
SELECT test('hello','world');
returns
Parser Error at or near ';'
then the database is telling you that you have a bad function, not that
it doesn't understand the SELECT.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, olebedev@waterford.org
Subject: Re: Calling Functions
In-Reply-To: <web-129183@davinci.ethosmedia.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox