Re: case statement within insert - Mailing list pgsql-general

From David G. Johnston
Subject Re: case statement within insert
Date
Msg-id CAKFQuwaGKoMW6fs=10HNhj_Fqb3c+J_==cuW1D+m3fdYCrf7KQ@mail.gmail.com
Whole thread Raw
In response to case statement within insert  (tango ward <tangoward15@gmail.com>)
List pgsql-general
On Friday, May 25, 2018, tango ward <tangoward15@gmail.com> wrote:

        WHEN code like '%%PE%%' or code like '%%NSTP%%'

I am getting TypeError: not all arguments converted during string formatting.

Any advice pls?

Unclear how to inject percent signs in the query string here.  I'd just avoid them and use regular expressions.

David J. 

pgsql-general by date:

Previous
From: tango ward
Date:
Subject: case statement within insert
Next
From: Igor Neyman
Date:
Subject: RE: Insert data if it is not existing