Hi, I would like to write some administration plpgsql scripts that populate some tables (dimension tables) and to execute them using 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 ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match