on 2019 May 29 5:59 AM
Hello All,
When i am executing the below code i am getting the error
‘SAP DBTech JDBC: [256]: sql processing error: search table error: “I049016″.”DO”: line 9 col 3 (at pos 261): [105] (range 1) NullConversion exception’
DO (OUT ot_result TABLE(text NVARCHAR(100))=>?)
BEGIN
DECLARE indx integer;
lt_tasks = SELECT TOP 5 * FROM task;
lt_status = SELECT * FROM status
WHERE id = ‘1’
ORDER BY id ASC;
FOR indx IN 1..10 DO
ot_result.text[:indx] = :lt_status.status_text[:lt_tasks.status[:indx]]
|| ‘ – ‘
|| :lt_tasks.title[:indx];
END FOR;
END;
Kindly let me know what is the issue with the above code ?.
Regards,
Alex
Request clarification before answering.
OT_RESULT contains no entries, therefore the index-based cell access does not work here, because it will return a null.
You have to use the .INSERT operation on the OT_RESULT table variable to add new lines. For details please check the online help.
Since HANA 2.0 SPS04 it is also possible to use DML Statements on table variables. If you are on that release, you can simply use the INSERT statement to create your data record (check the online help here).
Another better approach (e.g. performance) would be of course to do the logic directly in an SQL statement. If you can somehow join the task and status table that would be easy and you would not have to deal indexed based accesses.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
9 | |
9 | |
9 | |
7 | |
6 | |
6 | |
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.