cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointerException when retrieving empty clob from database

Former Member
0 Kudos

Hello,

When I try to retrieve an empty CLOB field from an Oracle database (SQL SELECT query), the return message says :

com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAP_BUD_ORDRE_INT' (structure 'Statement'): java.lang.NullPointerException

It's because JDBC returns a NULL pointer with an empty CLOB field.

It has nothing to do with the mappings but with the adapter itself.

How can I solve this issue?

Thanks in advance for your answers.

Kind regards,

Pierre Lejeune

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks for your answers guys. I finally did this :

SELECT coalesce(CLOB, to_clob('empty')) AS CLOB

FROM table

and changed the response mapping in order to check the value.

Former Member
0 Kudos

Hi Pierre,

Just put the CLOB field as occurence of 0..1 instead of 1..1 otehrwise before passing the value to the targe field use the mapwithdefault Standard function if there is not source field.

I think this may solve your problem.

Warm Regards,

Vijay

Former Member
0 Kudos

pierre,

check out this thread which I had created...

https://forums.sdn.sap.com/click.jspa?searchID=3550473&messageID=3145948

though there are no answers...and its just a problem, what I want to hightlight is, the statement

CLOB.createTemporary()

has problems in almost all app servers and the application server APIs need to be used in the case when this statement must be executed. e.g. WSJDBCutil class in case of IBM WAS.

in your case, if the statement above, is getting executed may even be implicitely, only some one from SAP can answer if this problem has been taken care off in the XI JDBC adapter design / implementation.

OSS might help

Former Member
0 Kudos

Hi Pierre,

in select query use ISNULL(CLOB,'') AS CLOB instead of writing CLOB directly...

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Hi;

You should have the occurance of the CLOB field as 0..1 and not 1..1.Check this out

Mudit