Skip to Content
0

SAP HANA querry

May 29, 2017 at 11:55 AM

46

avatar image
Former Member

Hello

I have a problem in VISUAL STUDIO C# 2015 with convert MS SQL Merge Querry to HANA

please help

In example in

https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.01/en-US/3226201f95764a57810dd256c9524d56.html

there is for the one table, but i have few tables


MERGE ORTT AS trgt
USING (select CurrCode, @rateDate as RateDate, @rate as Rate from OCRN where ISOCurrCod=@currency) AS src (CurrCode, RateDate, Rate )
ON trgt.RateDate = src.RateDate and trgt.Currency = src.CurrCode
WHEN MATCHED THEN UPDATE SET trgt.Rate = src.Rate
WHEN NOT MATCHED THEN
INSERT(RateDate,Currency,Rate)
VALUES(src.RateDate,src.CurrCode,src.Rate)

.................................

it doesn't work :(

.................................

MERGE INTO (select "CurrCode", '20170529' as "RateDate", 3.867500 as "Rate" from "SBODEMOPL".OCRN where "ISOCurrCod"='GBP') AS SRC ("CurrCode", "RateDate", "Rate" ) --"SBODEMOPL".OCRN
USING "SBODEMOPL".ORTT
ON "SBODEMOPL".ORTT.RateDate = "SBODEMOPL".SRC.RateDate and "SBODEMOPL".ORTT.Currency = "SBODEMOPL".SRC.CurrCode
WHEN MATCHED THEN UPDATE SET "SBODEMOPL".ORTT.Rate = "SBODEMOPL".SRC.Rate"

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers