phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MatjaĆŸ Trtnik ...@salviol.com>
Subject Re: insert dynamic columns. Number of columns upserting must match number of values
Date Sun, 30 Aug 2015 20:58:07 GMT
You have to skip VARCHAR in your upsert statement:

upsert into cross_id_attributes (crossId, id1, id2) values ('crossIdvalue','id1Value','id2Value')

Sent from my iPhone

On 30 Aug 2015, at 22:38, Serega Sheypak <serega.sheypak@gmail.com<mailto:serega.sheypak@gmail.com>>
wrote:

Hi, Getting error which confuses me.
Here is DDL:
CREATE TABLE IF NOT EXISTS cross_id_attributes
(
   crossId        VARCHAR   NOT NULL
   CONSTRAINT cross_id_reference_pk  PRIMARY KEY (crossId)
)

Here is upsert query:
upsert into cross_id_attributes(crossId VARCHAR, id1 VARCHAR, ,id2 VARCHAR)values('crossIdvalue','id1Value','id2Value')

And exception is:
Number of columns upserting must match number of values. Numbers of columns: 4. Number of
values: 3

What does it mean? I have three cols and 3 values

Mime
View raw message