dynamic queries - Mailing list pgsql-general

From Uros
Subject dynamic queries
Date
Msg-id 515506940.20040127161048@sir-mag.com
Whole thread Raw
In response to Re: Newbie to Postgres - Urgent query  (Ritu Khetan <ritu@netcore.co.in>)
List pgsql-general
Hello!

I want to execute some dynamic query from for loop in plpgsql
But i don't know how to add vaules like boolean or integer. With text type
works.

Here is my query. As you can see I tried with ::text but with no luck.

EXECUTE ''UPDATE directory_entry set
            "caption" = '' || quote_literal(tmp.caption) || '',
            "description" = '' || quote_literal(tmp.description) || '',
            "keywords" = '' || quote_literal(tmp.keywords) || '',
            "url" = '' || quote_literal(tmp.url) || '',
            "is_company" = '' || tmp.is_company::text || '',
            "is_novelty" = '' || tmp.is_novelty::text || '',
            "expire" = '' || tmp.expire::text || '',
            "modified" = ''''now'''' where id_entry='' || tmp.id_entry;

tia

Uros


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Foreign keys on inherited attributes
Next
From: Lamar Owen
Date:
Subject: Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0