Search Postgresql Archives

PlPg/SQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

How can i return one more row form a pgpl/sql function?

CREATE OR REPLACE FUNCTION GetRows(INTEGER, INTEGER, INTEGER) RETURNS
TEXT AS $$
	DECLARE
		Rows table_name%ROWTYPE;
	BEGIN
		SELECT * INTO Rows FROM table1_name WHERE id = $1;
		-- Return (1, 'Smis', 'smis@xxxxxxxxx')
		SELECT * INTO Rows FROM table2_name WHERE id = $2;
		-- Return (2, 'Ashle', 'Ashle@xxxxxxxxx')
		SELECT * INTO Rows FROM table3_name WHERE id = $3;
		-- Return (1, 'Galaxy University', 'g-uni@xxxxxxxxx')

		RETURN Rows;
	END;
$$ LANGUAGE 'plpgsql';

SELECT * FROM GetRows(1,2,3);

I want return for all 3 row in one table? How can i do that?



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux