dynamic queries

From: Uros <uros(at)sir-mag(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: dynamic queries
Date: 2004-01-27 15:10:48
Message-ID: 515506940.20040127161048@sir-mag.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2004-01-27 15:20:32 Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0
Previous Message Stephan Szabo 2004-01-27 14:50:16 Re: Foreign keys on inherited attributes