on 10-10-2017 2:51 PM
Hi Guys,
I was going through the SQL developer guide to find a solution about Table variables with below link.
SQL HANA Developer Guide - Table Variables
I found that there is a way through which we can modify the contents of table inside procedures. Also, through a function called RECORD_COUNT, we can find the number of records a table contains. I applied that in my table function but I am facing syntax errors. I have followed exact syntax which is mentioned in above link. Please help.
FUNCTION "BIUSER"."GK1.Func_Proc::t1acdoca" ( )
RETURNS "ACDCA" -- Table type
LANGUAGE SQLSCRIPT SQL
SECURITY INVOKER
DEFAULT SCHEMA BIUSER
AS
lv_row_count INTEGER;IDX INTEGER;MAXID INTEGER;
BEGIN
DECLARE TEMP ACDCA; -- ACDCA is a table type
TEMP = SELECT "RLDNR", "RBUKRS", "GJAHR", "BELNR", "DOCLN", "RYEAR", "AUGBL", "AUGGJ", "BLART", "WSL", "HSL"
FROM "_SYS_BIC"."GK1/CV_ACDOCA";
MAXID = RECORD_COUNT(:TEMP); ----SYNTAX ERROR
FOR IDX IN 1..MAXIDX DO
--Logic to modify table
TEMP[IDX] = (:TEMP.RLDNR[:IDX], '0L'); -- SYNTAX ERROR
END FOR;
RETURN :TEMP;
END;
Thanks,
Gaurav
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.