Search Postgresql Archives

table name as variable within Function

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

 



Here is an example of what i would like to do...
---------------------------------------
CREATE FUNCTION fun_totalrecords(varchar) RETURNS int8 AS'
DECLARE
theTable ALIAS FOR $1;
result int := 0;
BEGIN
result = COUNT(*) FROM theTable; -- this is where i need help
 
RETURN result;

END; 'LANGUAGE 'plpgsql';
---------------------------------------
Thanks for the help....
Clark
 

[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