How to create a stand alone plpgsql proc

From: s8854617 <s8854617(at)sinamail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to create a stand alone plpgsql proc
Date: 2001-08-15 05:19:39
Message-ID: 20010815051939.27447.qmail@sinamail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Dear Sir:
In Oracle, I can create a stand-alone procedure like that:
DECLARE
A NUMBER;
B NUMBER;
BEGIN
A := 1;
B := 2;
INSERT INTO TABLE1 VALUES (A, B);
END;
/
Then I run it(a.sql) with the command in shell:
sqlplus username/passwd @a.sql
In postgresql, how do I write similar plpgsql procedure without
using "CREATE FUNCTION" or "CREATE PROCEDURE" ..., and how to
execute it?
Thank you
==================================================================
新浪網.免費 50MB 電子信箱 http://www.sinamail.com

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Fordyce 2001-08-15 05:40:15 OpenBSD 2.9 - installation works fine but psql won't run
Previous Message Stephan Szabo 2001-08-15 04:38:05 Re: Null Conversion