cancel
Showing results for 
Search instead for 
Did you mean: 

NullConversion exception’

alex_georgek
Associate
Associate
0 Kudos
1,242

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

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

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.

Answers (0)