Re: [SQL] tablename as function parameter

2005-03-20 Thread Jonathan Daugherty
# I'm trying to create a function (language 'sql') with table name as # single input parameter, but I always get syntax errors at # "$1". Probably I am use wrong types. # # simple example: # # create function testfct (text) language sql as 'select count(*) from # $1' This doesn't work because th

[SQL] tablename as function parameter

2005-03-20 Thread Hermann Draeger
I'm trying to create a function (language 'sql') with table name as single input parameter, but I always get syntax errors at "$1". Probably I am use wrong types. simple example: create function testfct (text) language sql as 'select count(*) from $1' fails. I tested type alternatives to 'text