I have problem with updating values in apache phoenix . The below query is throwing JDBC exception. I am new to Pheonix JDBC and confusing with upsert query usage for updating non primary key field values.
String sql = UPSERT INTO mytable (serverName,SationName, product) SELECT serverName,stationName ‘sampleProduct’ FROM mytable WHERE product = ‘sampleProduct’;
The primary key of "myTable" is combination of "serverName" and "StationName". I would like to update value of product column from 'sampleProduct' to 'TestProduct'.
"The primary key of "myTable" is combination of "serverName" and "StationName". I would like to update value of product column from 'sampleProduct' to 'TestProduct'."
You say nothing about "inserting if the row does not already exist, so I don't see
UPSERT
as being appropriate. The MySQL code is(I don't know what values are needed for '...'.)