Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

merge not working in vsql/shell script, but working well in DBeaver

I have a merge script working well at DBeaver, but not working in vsql or shell script. the sql query is like:

Merge into Production.DEMO_Stock tgt USING Production.New_Temp_Stock src on src.Sitecode=tgt.Sitecode AND src.Stkno=tgt.Stkno WHEN MATCHED THEN UPDATE SET Active=src.Active, APN=src.APN, Description=src.Description, LastCost=src.LastCost, Manufacturer=src.Manufacturer, mnpn=src.mnpn, ModifiedDate=src.ModifiedDate, Stock_PDE=src.Stock_PDE, Product_Price=src.Product_Price, sgroup=src.sgroup, SOH=src.SOH WHEN NOT MATCHED THEN insert values(src.Active, src.APN, src.Description, src.LastCost, src.Manufacturer, src.mnpn, src.ModifiedDate, src.Stock_PDE, src.Product_Price, src.sgroup, src.Sitecode, src.Stkno, src.SOH);

 

I just want to merge data from New_Temp_Stock table into DEMO_Stock table.

 

(I tried before to insert filed names in before "values", which will be the same.---it is no problem.) The strange thing is that I have not got any error message, it seems everything goes well. But after merging, I tried to query, the target table seems not change at all. The information in source table is not in target table at all. Please see below vsql feeds back:

OUTPUT
-----------
11740
(1 row)

Can someone help me sort out this issue? thanks!

LindaBris

Comments

  • Your GUI for Vertica automatically add commit
    use ";COMMIT;" in shell

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.