#1  
Old 3rd February 2011, 10:24
Adarsh Adarsh is offline
Junior Member
 
Join Date: Feb 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default 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
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fedora 10 perfect server network issue Turbanator HOWTO-Related Questions 2 14th February 2009 01:37
DNS MX Issue jmead Installation/Configuration 3 29th November 2007 10:06
SSL Issue - Unable to connect to any site Menzor Installation/Configuration 4 27th May 2007 04:03
Re: Postfix how-to and postgres mattg HOWTO-Related Questions 1 10th January 2007 17:29
iptables issue with xen perfect setup - debian alexnz HOWTO-Related Questions 3 25th November 2006 13:49


All times are GMT +2. The time now is 16:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.