Skip to Content
0

JDBC Receiver Table has columns with special charecters

Jul 19, 2017 at 05:11 PM

69

avatar image
Former Member

Hi, I am working on IDOC to JDBC insert scenario where DB2 table has multiple column names with special charecters e.g. PONO#, B8PL#, Y8LOC#. As it is in the receiver side, I can't define the structure with any other name and overwrite in the query. Can anyone suggest how to deal it?

Thanks

Vinay

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeniy Kolmakov Jul 22, 2017 at 08:04 PM
1

Hi Vinay!

XML Naming Rules

XML elements must follow these naming rules:

  • Element names are case-sensitive
  • Element names must start with a letter or underscore
  • Element names cannot start with the letters xml (or XML, or Xml, etc)
  • Element names can contain letters, digits, hyphens, underscores, and periods
  • Element names cannot contain spaces

I guess you can't use "#" and "$" symbols in XML element's name.

In such case I see two ways: to use SQL_DML JDBC message format or to request DB team on target side to make stored procedure for data insert/update.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
Manoj K Jul 19, 2017 at 05:21 PM
1

Hi Vinay,

Give a unique name for this character in your data type say # = _hash and include a java/xslt map later to replace the _hash back to #.

Br,

Manoj

Show 5 Share
10 |10000 characters needed characters left characters exceeded

And even more: why not to use XSL transformation instead of graphical mapping?

Regards, Eugene.

1

The reason why i proposed first to have graphical mapping because that would be the place where it is easy to implement business logic . As implementing logic in XSLT would be tricky and also needs XSLT knowledge and it will be tough for guys like me who doesn't has much idea on xslt :P must not suffer ;)

Br,

Manoj

1

Hi Manoj!

The point is that XSLT is not such a difficult to learn as it might seem to be. :-) Just give it a try!

Regards, Evgeniy.

1
Former Member

Thanks Manoj & Evgeniy for your suggestions.

I am trying with first graphical mapping and then using XSLT to change the columns in opration mapping. Below is the code.

http://www.w3.org/1999/XSL/Transform">

This code is working when I am trying to covert e.g. OrderCo to OrderCoT but it is not working if I am trying for OrderCo to OrderCo#. Am I doing something wrong? Please suggest.

Again thanks for your time as well suggestions.

Thanks

Vinay

0
Former Member

It seems code not inserted due to special characters. Uploading snapshot of screen.replacecolumn.png

replacecolumn.png (24.0 kB)
0
Evgeniy Kolmakov Jul 19, 2017 at 07:20 PM
1

Hi Vinay!

What is the number of fields and rows you want to insert from one source message?

In case you need to insert one row with few fields you could simply use SQL_DML message format where you compose SQL insert query text and that query is performed in target database.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded