cancel
Showing results for 
Search instead for 
Did you mean: 

file to JDBC error

Former Member
0 Kudos

hi

i'm following the document by Bhavesh kantilal on file to jdbc._https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3928_ [original link is broken] [original link is broken] [original link is broken]

however during execution,the JDBC communication channel throws the following error:Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COMPANY' (structure 'STATEMENT'): java.sql.SQLException: FATAL ERROR document format: structure 'STATEMENT', key element 'NAME' contains no values

we have mapped the Name and IBU to empty constants as told in the doc.

Kindly advise how to debug the problem.

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Check the JDBC document formats: [JDBC Document format for Receiver JDBC|http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm]

You have to provide the Mandatory fields.

Check my blog as well : [Best Practices with Receiver JDBC Adapter Document Formats|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12970] [original link is broken] [original link is broken] [original link is broken];

Thanks,

- Gujjeti.

Former Member
0 Kudos

hi praveen,

we went through your document.We too have the same MT for the DB request.In the Source , we are keeping the fields as empty constants just like u did.However , the above mentioned error comes nonetheless.

we are using oracle JDBC.is the procedure any different from MsSQL?

former_member181985
Active Contributor
0 Kudos

The document formats are independent of Database.

Can you post converted XML(Input File to JDBC Request) from SXMB_MONI.

Answers (3)

Answers (3)

Former Member
0 Kudos

hi praveen

thanks a lot for ur help.

its finally working:)

JoelTrinidade
Active Contributor
0 Kudos

Hi,

The mistake lies in "we have mapped the Name and IBU to empty constants". If you read carefully the objective in the blog is "Letu2019s say, we have an Employee Table EMPTEST with EmpNo and Name. We use a File to pass the EmpNo and the Operator to the JDBC adapter. This will dynamically select the data that satisfies the query from the database and finally push this data back to a file."

how can you fulfill the objective if you have necessary fields as empty.

Rgds

joel

Former Member
0 Kudos

hi,

Check the table which you created.Name should not be a primary key.

One more choice.Unmark the key tags mandatory tag in the receiver communication channel.

Regards,

Prakasu

Former Member
0 Kudos

hi prakasu

Name is not a mandatory field

Former Member
0 Kudos

hi prakasu

thanks to u, we unchecked the 'key tags madatory'.So now that error has gone.

however another error has come:Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COMPANY' (structure 'STATEMENT'): java.sql.SQLException: ORA-00936: missing expression

source structure:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_JDBC_SELECT_FILE_SRC xmlns:ns0="">

<REQUEST>

<EMPNO>1</EMPNO>

<OPERATION>GT</OPERATION>

</REQUEST>

</ns0:MT_JDBC_SELECT_FILE_SRC>

Db req:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_JDBC_SELECT_FILE_REQ xmlns:ns0=""><STATEMENT><COMPANY ACTION="SELECT"><TABLE>COMPANY</TABLE></COMPANY><ACCESS><NAME></NAME><IBU></IBU></ACCESS><KEY><EMPNO compareOperation="GT">1</EMPNO></KEY></STATEMENT></ns0:MT_JDBC_SELECT_FILE_REQ>

former_member181985
Active Contributor
0 Kudos

>

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_JDBC_SELECT_FILE_REQ xmlns:ns0=""><STATEMENT><COMPANY ACTION="SELECT"><TABLE>COMPANY</TABLE></COMPANY><ACCESS><NAME></NAME><IBU></IBU></ACCESS><KEY><EMPNO compareOperation="GT">1</EMPNO></KEY></STATEMENT></ns0:MT_JDBC_SELECT_FILE_REQ>

Your structure is wrong. It should be as below

<ns0:MT_JDBC_SELECT_FILE_REQ xmlns:ns0="">
<STATEMENT>
<COMPANY ACTION="SELECT">
<TABLE>COMPANY</TABLE>
<ACCESS>
<NAME></NAME>
<IBU></IBU>
</ACCESS>
<KEY>
<EMPNO compareOperation="GT">1</EMPNO>
</KEY>
</COMPANY>
</STATEMENT>
</ns0:MT_JDBC_SELECT_FILE_REQ>

Hence you have to change the Data Type Accordingly. Also Check Key Tags as Mandatory in

JDBC Receiver Communication Channel

Edited by: Praveen Gujjeti on Feb 27, 2009 1:25 PM