phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Heather <james.heat...@mendeley.com>
Subject Re: perhaps dumb question? workaround for default values
Date Thu, 10 Sep 2015 20:52:25 GMT
You want to use an UPSERT SELECT.

     UPSERT INTO mytable (primary_key_col, PULL_DATE) SELECT 
primary_key_col, CURRENT_DATE() FROM mytable;

James

On 10/09/15 20:40, M. Aaron Bossert wrote:
> I have a table that requires an additional column with the current 
> date added.  I realize that I can't do this using the CSV 
> importer...How can I do that in a query?  I tried standard SQL with 
> UPSERT instead of INSERT:
>
> UPSERT INTO NG.BARS_CNC_DETAILS_HIST SET PULL_DATE=CURRENT_DATE();
>
>
> but this gives a syntax error.
>


Mime
View raw message