cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC XML format exception

Former Member
0 Kudos

Hi experts,

<u>I receive this exception</u> in my JDBC receiver adapter:

<i>- 2007-10-01 17:41:25 CEST: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'T_ECRITUREC_G' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The name 'a' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.</i>

This is my table:

<a href="http://img299.imageshack.us/my.php?image=screenhunter186rq8.png">[img=http://img299.imageshack.us/img299/9339/screenhunter186rq8.th.png]</a>

And this is my XML:

<a href="http://img204.imageshack.us/my.php?image=screenhunter188qw6.png">[img=http://img204.imageshack.us/img204/4549/screenhunter188qw6.th.png]</a>

Does anybody have any idea about what will the problem be?

Regards

Gonzalo

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Gonzalo,

I am a new XIer and do not know, whether my suggestion is right.

My Suggestion:

Try to replace the tag name "DOCUMENT" with "access".

hope it is useful.

regards

Bin

null

Former Member
0 Kudos

Hi,

Do you have any consistency check at database side on the fields you are putting the value "a" ? Try putting real information to test it.

regards.

roberti

Former Member
0 Kudos

You are right, that field is mandatory. But I have already checked with this field configuration too:

<a href="http://img509.imageshack.us/my.php?image=screenhunter189nh9.png">[img=http://img509.imageshack.us/img509/2527/screenhunter189nh9.th.png]</a>

And I receive the same error.

Thanks for your help, Bin.

Regards

Gonzalo

Former Member
0 Kudos

Hi !

Try to use "T_ECRITUREC_G" as dbTableName in the <content> tag, as

<T_ECRITUREC_G action="INSERT">

<table>T_ECRITUREC_G</table>

......

if still receiving error, please send screenshot of the error.

Regards,

Matias.

bhavesh_kantilal
Active Contributor
0 Kudos

You would need to use the attribute hasQuot. Your database structure has Integer / numbers and by default all the elements have a Quot ' ' associated with it.

Use all table elements with attribute hasQuot with value as NO and then try this out.

Regards

Bhavesh

Answers (2)

Answers (2)

0 Kudos

Hi Gonzalo,

in your table definition, the element "EC_NORME" is defined as integer:

[EC_NORME] [int] NULL,

But in your xml file, you gave a non-integer value "a" in this field:

<EC_NORME>a</EC_NORME>

Maybe this is the problem.

regards

Bin

Former Member
0 Kudos

Hi,

Yes Bin expectations my be correct , bcz im unable to open your links , but, what he said is valid.

if you decalre a field as integer and iserting the char value , it will be the problem while insterting the data into a table.

try to change the value with integer ?? will it works??

Chilla

Former Member
0 Kudos

That helped, Bin. Now I have received a different error:

<i>-2007-10-02 10:38:51 CEST: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'T_ECRITUREC_G' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]INSERT permission denied on object 'T_ECRITUREC_G', database 'INFCONTA', owner 'dbo'.</i>

I tried too with waht you said Mathias, it didn't work, I think that this field isn't mandatory.

For the changes proposed by Bavesh, I'm not the owner of the DB. I told them to try and then I will tell you.

If somebody have any idea about the last error...

Thank you everybody.

Regards

Gonzalo

Former Member
0 Kudos

Hi,

good to change a to number values..

now check the authorisations to insert ..

Chilla

Former Member
0 Kudos

Hi !

Now it seems to be a permission problem. Try to execute the same sql statement in sql query analyzer, it maybe will give you the same error.

Regards,

Matias.

bhavesh_kantilal
Active Contributor
0 Kudos

The changes I have suggested need to be done on the datatype crteated in XI and not on the database.

For all Columns that are non char / non varchar , you need to use the Attribute hasQuot with value =No so that XI does not add the single Quote when constructing the SQL Query.

This is also explained in one of the links given in the reply above.

Regards

Bhavesh

Former Member
0 Kudos

It was probably the SQL user in the JDBC adapter. It hadn't write permissions. I'll tell you about when I had the new user.

Regards

Gonzalo

Former Member
0 Kudos

Hi Gonzalo !

Please check that your XML document has the format described in

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

<StatementName2>

<dbTableName action=”INSERT”>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<access>

<col1>val11</col1>

</access>

</dbTableName>

</StatementName2>

/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step

/people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response

Regards,

Matias.

ps: please award point if helpful

Message was edited by:

Matias Denker

Message was edited by:

Matias Denker