I've got a .net application that runs a sql script to populate a staging table. It's written to be generic - ODBC connection to the feed system(s), and the sql is read from a text file that is configured for each customer (using OdbcCommand - so the SQL is just a string). A bunch of parameters are passed in to cater for all scenarios.
So far, the only systems we've interfaced with have been sql server. An ODBC connection doesn't support named parameters, so the (sql server) sql script looks something like
DECLARE @period varchar(4) = ?;
DECLARE @actuality varchar(2) = ?;
SELECT sum(myamount) as amount from mytable where myperiod=@period and myactuality = @actuality;
All works hunky dory
I need to be able to do the same with a HANA database, but can't work out the variable syntax
With the help of google, I've got -
declare period varchar(4) := ?;
declare actuality varchar(2) := ?;
SELECT sum(MYAMOUNT) as amount from MYTABLE where MYPERIOD=eriod and MYACTUALITY=:actuality;
But I get a syntax error on declare
To add to the difficulty, I only have access to configure the system via a webex screenshare, where every mouse click or keystroke comes with a 2 second timelag, so it's not easy just to edit and try stuff.#
How do I declare variables in HANA?
Any clues?
So far, the only systems we've interfaced with have been sql server. An ODBC connection doesn't support named parameters, so the (sql server) sql script looks something like
DECLARE @period varchar(4) = ?;
DECLARE @actuality varchar(2) = ?;
SELECT sum(myamount) as amount from mytable where myperiod=@period and myactuality = @actuality;
All works hunky dory
I need to be able to do the same with a HANA database, but can't work out the variable syntax
With the help of google, I've got -
declare period varchar(4) := ?;
declare actuality varchar(2) := ?;
SELECT sum(MYAMOUNT) as amount from MYTABLE where MYPERIOD=eriod and MYACTUALITY=:actuality;
But I get a syntax error on declare
To add to the difficulty, I only have access to configure the system via a webex screenshare, where every mouse click or keystroke comes with a 2 second timelag, so it's not easy just to edit and try stuff.#
How do I declare variables in HANA?
Any clues?
Comment