Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f924GZn07174 for ; Tue, 2 Oct 2001 00:16:35 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 129183; Mon, 01 Oct 2001 21:16:33 -0700 From: "Josh Berkus" Subject: Re: Calling Functions To: Oleg Lebedev , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Mon, 01 Oct 2001 21:16:33 -0700 Message-ID: In-Reply-To: <3BB90E21.F8E6CE80@waterford.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_===129183====davinci.ethosmedia.com===_" X-Archive-Number: 200110/4 X-Sequence-Number: 4959 This is a multi-part MIME message --_===129183====davinci.ethosmedia.com===_ Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: 8bit 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 --_===129183====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===129183====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===129183====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===129183====davinci.ethosmedia.com===_--