on 07-19-2017 6:11 PM
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
Hi Vinay!
XML elements must follow these naming rules:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And even more: why not to use XSL transformation instead of graphical mapping?
Regards, Eugene.
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
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.
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
It seems code not inserted due to special characters. Uploading snapshot of screen.replacecolumn.png
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.