Re: Select Command in Procedures

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

 



* Adarsh Sharma wrote:

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';

You are using single quotation marks around your function body already. Use dollar quoting instead.

--
Christian

--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux