cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Receiver Table has columns with special charecters

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor

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.

Answers (2)

Answers (2)

former_member190293
Active Contributor

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.

manoj_khavatkopp
Active Contributor

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

former_member190293
Active Contributor

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

Regards, Eugene.

manoj_khavatkopp
Active Contributor

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 😛 must not suffer 😉

Br,

Manoj

former_member190293
Active Contributor

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.

0 Kudos

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.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="access/OrderCo"> <OrderCo#> <xsl:apply-templates select="@*|node()"/> </OrderCo#> </xsl:template> <xsl:template match="access/OrderNo"> <OrderNo{replace12}gt; <xsl:apply-templates select="@*|node()"/> </OrderNo{replace14}gt; </xsl:template> </xsl:stylesheet>

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 Kudos

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