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      [EMAIL PROTECTED]
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco




---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to