on 05-23-2014 2:24 PM
Hi there,
we struggle while using the getData() function to insert data into HANA.
Here is our test coding:
typedef [
binary HeaderId;
Timestamp "Timestamp";
string SystemType;
string SystemId;
| ] ts_Log_Header ;
vector ( ts_Log_Header ) lt_Log_Header ;
getData( lt_Log_Header,
'ServiceHDBANA',
'Insert into "SAP_SEC_MON"."sap.secmon.db::Log.LogHeader" values ( ?, ?, ?,? )', WithNullIDs.HeaderId, WithNullIDs."Timestamp", 'PILLE', '');
We see the following error in the console output as well as in the project log file:
Error:
2014-05-23 14:41:46.718 | 6924 | container | [SP-3-100005] (18.299) sp(18744) Error retrieving column 1 value from result set.
2014-05-23 14:41:46.718 | 6924 | container | [SP-3-100005] (18.299) sp(18744) A result row is skipped due to error retrieving column data.
2014-05-23 14:41:46.718 | 6924 | container | [SP-3-104003] (18.299) sp(18744) Error in function 'getData': Error iterating result set
2014-05-23 14:41:46.734 | 6924 | container | [SP-4-131038] (18.315) sp(18744) Stream(): error occurred in computation of row.
The according schema of the table in HANA looks like this:
CREATE COLUMN TABLE "SAP_SEC_MON"."sap.secmon.db::Log.LogHeader" ("HeaderId" VARBINARY(16) CS_RAW,
"Timestamp" LONGDATE CS_LONGDATE,
"SystemType" NVARCHAR(50),
"SystemId" NVARCHAR(5000))
Any help would be appreciated.Or is there any example coding available ?
We´re using ESP SP04 on a windows machine.
Hi,
Create a procedure in HANA that handles the insert, and have it return a dummy record, something similar to this:
HANA Procedure:
CREATE PROCEDURE insert_stock (symbol varchar(10), volume integer, price float)
LANGUAGE SQLSCRIPT AS
BEGIN
INSERT INTO "SYSTEM"."stock" values(symbol, volume, price);
SELECT ::ROWCOUNT FROM DUMMY;
END
ESP CCL:
CREATE INPUT stream StockStream SCHEMA (symbol string, volume integer, price float);
CREATE Flex stock_flex
IN StockStream
OUT OUTPUT STREAM stock_traded SCHEMA(symbol string, volume integer, price float)
BEGIN
DECLARE
/* The typedef must be the same as the return value of the stored procedure. */
typedef [integer dummydata;|] datarec;
/* dummydatarec is a vector variable to store the return value of the stored procedure */
vector(datarec) dummydatarec;
END;
ON StockStream {
if ( isnull(dummydatarec) ) {
dummydatarec := new vector(datarec);
}
getData(dummydatarec, 'HANAODBCService',
'CALL "SYSTEM"."INSERT_STOCK" (?,?,?)',
StockStream.symbol, StockStream.volume, StockStream.price );
resize(dummydatarec,0);
};
END;
Hope that helps!
Thanks,
Alice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
perpfect, works fine !
thanks a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
26 | |
9 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.