Update cell data to Database Table

Update cell data to Database Table

anutt_k
Not applicable
111 Views
4 Replies
Message 1 of 5

Update cell data to Database Table

anutt_k
Not applicable

[ FlexSim 23.1.2 ]

Hello. I want to export data from FlexSim GlobalTable to Database Table (SQL Server).

Now I can use this script to INSERT data to Database Table.

1688314242482.png

But INSERT It will be add new row in Database Table everytime when execute the script.

1688314365451.png

Then, I has change from INSERT to UPDATE for update new data only. (I won't to add new row). So that invalid.

1688314394040.png

1688314405987.png

How can I just update new data to old row and won't to add new row in Database Table. Thank You.

0 Likes
Accepted solutions (1)
112 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

Either DELETE * FROM test2 and then perform inserts for the whole table, or update based on a unique field combination (key ) using the WHERE clause.

0 Likes
Message 3 of 5

anutt_k
Not applicable
Can you give some exam script ?
0 Likes
Message 4 of 5

moehlmann_fe
Enthusiast
Enthusiast
UPDATE Test2 SET C1 = :C1, C2 = :C2, C3 =  :C3 WHERE ID == :ID

Requires to bind the ID column value as a parameter as well to be able to find the matching row in the WHERE clause.

Message 5 of 5

julie_weller
Not applicable

Hi @Anutt K, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes