Postgres Procedures Issue
*****
New member
Joined: 02/02/2011 18:37:11
Messages: 1
Online
Dear all,
I am able to execute command successfully through CLI or pgAdmin .
create table user_news_new as select record_id,field_name,field_value,news_date from user_news where field_name in ('SOI','RelLoc','Description','Heading','news_date ') and field_value != '' ;
But I don't know when I put this command in a procedure, it shows error :
CREATE FUNCTION user10() RETURNS void AS'
DECLARE
BEGIN
create table user_news_new as select record_id,field_name,field_value,news_date from user_news where field_name in ('SOI','RelLoc','Description','Heading','news_date ') and field_value != '' ;
END;
' LANGUAGE 'plpgsql';
Error :
globe=# CREATE FUNCTION user10() RETURNS void AS'
globe'# DECLARE
globe'# BEGIN
globe'# create table user_news_new as select record_id,field_name,field_value,news_date from user_news where field_name in ('SOI','RelLoc','Description','Heading','news_date ') and field_value != '' ;
globe'# END;
globe'# ' LANGUAGE 'plpgsql';
ERROR: syntax error at or near "SOI"
LINE 4: ...ue,news_date from user_news where field_name in ('SOI','RelL...
^
Please help as I stuck with this issue. I don't why it is not executed in a procedure.
Thanks & Regards
Adarsh Sharma
|
Recent comments
14 hours 56 min ago
17 hours 51 min ago
19 hours 5 min ago
20 hours 29 min ago
22 hours 7 min ago
23 hours 35 min ago
1 day 49 min ago
1 day 16 hours ago
1 day 17 hours ago
1 day 21 hours ago