Executing plpgsql scripts using psql, is that possible? - Mailing list pgsql-sql

From Daniel CAUNE
Subject Executing plpgsql scripts using psql, is that possible?
Date
Msg-id 0IT6005QV7JN4WX1@VL-MO-MR004.ip.videotron.ca
Whole thread Raw
Responses Re: Executing plpgsql scripts using psql, is that possible?  (John DeSoi <desoi@pgedit.com>)
List pgsql-sql
Hi,

I would like to write some administration plpgsql scripts that populate some tables (dimension tables) and to execute
themusing psql.  I’m not sure that is possible with psql as it is with Oracle sqlplus or SQL Server MSQuery: 

Oracle sqlplus:
---------------
DECLARE V_MyObjectID bigint;
BEGIN V_MyObjectID := RegisterMyObject('a string', 'another string'); AddObjectProperty(V_MyObjectID, 'a string');
AddObjectProperty(V_MyObjectID,'another string'); 
END;

SQL Server MSQuery:
-------------------
DECLARE @MyObjectID int
SET @MyObjectID = RegisterMyObject('a string', 'another string')
EXECUTE AddObjectProperty(MyObjectID, 'a string');
EXECUTE AddObjectProperty(MyObjectID, 'another string');

Any idea how I can translate such a script for psql?  I mean, without creating a function that wraps the whole, of
course!:-) 

Thanks,


Daniel



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: What does "merge-joinable join conditions" mean ????
Next
From: John DeSoi
Date:
Subject: Re: Executing plpgsql scripts using psql, is that possible?