Executing plpgsql scripts using psql, is that possible?

Поиск
Список
Период
Сортировка
От Daniel CAUNE
Тема Executing plpgsql scripts using psql, is that possible?
Дата
Msg-id 0IT6005QV7JN4WX1@VL-MO-MR004.ip.videotron.ca
обсуждение исходный текст
Ответы Re: Executing plpgsql scripts using psql, is that possible?  (John DeSoi <desoi@pgedit.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: What does "merge-joinable join conditions" mean ????
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Executing plpgsql scripts using psql, is that possible?