cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Query to Update a table

Former Member
0 Kudos

Hi   HANA experts,

I have some doubt in SQL HANA qurey to update the table content.

My requirement is say example i need to change the content of column where ever texas is there,i need to change it as Michigan.

UPDATE “Claim_Value.T790” set  State  =  michigan WHERE  State  =  Texas; this is not working

when i google i could find only the update query if the content is integer value..can anybody help to solve this??

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Neeraja

Regards,

Khaga

lucas_oliveira
Advisor
Advisor
0 Kudos

Hi,

Please do not revive dead-old-and-answered threads (see ).

BRs,

Lucas de Oliveira (moderator)

former_member210482
Active Participant
0 Kudos

Hi Neeraj,

Syntax to update is as follows

UPDATE "schema_name"."Table_name" SET "field_name" = 'value' WHERE "field_name" = 'value';

Try giving double quotes for field name too. If your value is a number, enter it directly without quotes.

Former Member
0 Kudos

Hi Neeraja-

Please enclose your string with the single quotes

UPDATE “Claim_Value.T790” SET  state  =  'Michigan' WHERE  state  =  'Texas';

Thanks

Former Member
0 Kudos

still its  giving error 😞

Former Member
0 Kudos

UPDATE “Claim_Value.T790” SET region = 'North' WHERE region = 'South'


sql syntax error: incorrect syntax near "region": line 1 col 43 (at pos 43)

Former Member
0 Kudos

You have not given schema name correctly. For the table name you can drag the table listed into the editor which will automatically populate the name.

UPDATE "Claim_Value"."T790" SET  state  =  'Michigan' WHERE  state  =  'Texas';

Former Member
0 Kudos

thats what exacly i did...i dragged and put...here i made a typing misatke.

Former Member
0 Kudos

is the sytax correct?? should the state be in single quotes??

UPDATE “Claim_Value"."T790” SET region = 'North' WHERE region = 'South'

Former Member
0 Kudos

Looks like the codes for the table name you have given are not correct.

UPDATE “Claim_Value"."T790” SET region = 'North' WHERE region = 'South';


Give this and try "Claim_Value"."T790"


Thanks

Former Member
0 Kudos

thank you...let me try.