Search Postgresql Archives

How to deal with NULL values on dynamic queries?

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

 



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,



[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