Search Postgresql Archives

Re: dynamic SQL - variable substitution in plpgsql

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

 



km wrote:
Hi all,

i could not do variable substitution in plpgsql procedure.
The variable names are taken as it is but not substituted in the SQL query.
what could be the problem ?

FOR result IN "SELECT x,y,z FROM mydata WHERE x = a AND y < b AND z > c" LOOP
	RETURN NEXT  result;
I don't think you need the quotes around your select statement.

Later,

--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux