I am having a problem declaring a char variable in a function. I am getting a syntax error near ' where I declare cat_num_pass.
This is the function
create function get_scripts3(int4) returns int4 as'
DECLARE
num_scripts alias for $1;
cat_id int4;
cat_num_pass char ''T''
BEGIN
select into cat_id count(*) from d_articles where cat_id = num_scripts and app_flg = cat_num_pass;
return cat_id;
END;
'language 'plpgsql;
I am using postgresql 7.2.2
Secondly I need to get a sample function that can return a table
Thanks for the help
This is the function
create function get_scripts3(int4) returns int4 as'
DECLARE
num_scripts alias for $1;
cat_id int4;
cat_num_pass char ''T''
BEGIN
select into cat_id count(*) from d_articles where cat_id = num_scripts and app_flg = cat_num_pass;
return cat_id;
END;
'language 'plpgsql;
I am using postgresql 7.2.2
Secondly I need to get a sample function that can return a table
Thanks for the help