How to deal with NULL values on dynamic queries?

Поиск
Список
Период
Сортировка
От Andre Lopes
Тема How to deal with NULL values on dynamic queries?
Дата
Msg-id g2y18f98e681005061602i66bb54bdifa504af74c0028@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to deal with NULL values on dynamic queries?  (Kenichiro Tanaka <ketanaka@ashisuto.co.jp>)
Re: How to deal with NULL values on dynamic queries?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

I have a query that some values could be NULL, how can I deal with this problem?

[code]
  EXECUTE 'INSERT INTO '
        || quote_ident(pNOME_VIEW)
        || '('
        || quote_ident(pCHAVE_1)
        || ', DAT_INICIO, DAT_FIM, COMENT) values ('
        || quote_literal(pVAL_CHAVE_1)
        || ', '
        || quote_literal(pVAL_CHAVE_2)
        || ', '
        || quote_literal(pVAL_CAMPO1)
        || ', '
        || quote_literal(pVAL_COMENT)
        || ')';
[/code]

The variable pVAL_COMENT could be NULL or have a value. How can I deal with this?

Sorry the bad english.

Best Regards,


В списке pgsql-general по дате отправления:

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: 02/09 SFPUG meeting, "Hot Standby and Streaming Replication," video now available
Следующее
От: Bryan Murphy
Дата:
Сообщение: missing chunk number 0 for toast value 25693266 in pg_toast_25497233