|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Invalid characters |
« View previous topic :: View next topic » |
Author |
Message
|
cvag |
Posted: Fri Jun 08, 2012 9:27 pm Post subject: Invalid characters |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi,
Testing on one sample flow to resolve production issue, am parsing xml file with XMLNSC parser and inserting those values into the database.
But facing problem with the book attribute value (id)
Error : Invalid characters
Sample XML:
<catalog>
<book id='bk101'>
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications with XML.</description>
</book>
<book id='bk102'>
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.</description>
</book>
</catalog>
ESQL:
Code: |
INSERT INTO Database.SAMPLE.DETAILS(NO, NAME, TITLE, GENRE, PRICE, DATE, DESCRIPTION, TOTAL_DATA)
VALUES(CAST(inpRef.book[i].(XMLNSC.Attribute)id AS INTEGER), inpRef.book[i].(XMLNSC.Field)author,
inpRef.book[i].(XMLNSC.Field)title, inpRef.book[i].(XMLNSC.Field)genre, CAST(inpRef.book[i].(XMLNSC.Field)price AS DECIMAL),
CAST(inpRef.book[i].(XMLNSC.Field)publish_date AS DATE), inpRef.book[i].(XMLNSC.Field)description,
ASBITSTREAM(inpRef.book[i]ENCODING InputRoot.Properties.Encoding CCSID InputRoot.Properties.CodedCharSetId));
|
Quote: |
ExceptionList:
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:957
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_1
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbComputeNode.cpp
Line:INTEGER:464
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_3
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.DB_Insert
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
Line:INTEGER:602
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_3
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.DB_Insert
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:com.msg.DBOperations.DatabaseInsert.Main
Insert
Type:INTEGER:5
Text:CHARACTER:13.4
Insert
Type:INTEGER:5
Text:CHARACTER:INSERT INTO Database.SAMPLE.DETAILS ( NO, NAME, TITLE, GENRE, PRICE, DATE, DESCRIPTION, TOTAL_DATA ) VALUES (CAST(inpRef.book[i].(XMLNSC.Attribute)id AS INTEGER), inpRef.book[i].(XMLNSC.Field)author, inpRef.book[i].(XMLNSC.Field)title, inpRef.book[i].(XMLNSC.Field)genre, CAST(inpRef.book[i].(XMLNSC.Field)price AS DECIMAL), CAST(inpRef.book[i].(XMLNSC.Field)publish_date AS DATE), inpRef.book[i].(XMLNSC.Field)description, ASBITSTREAM(inpRef.book[i] ENCODING InputRoot.Properties.Encoding CCSID InputRoot.Properties.CodedCharSetId) )
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlTypeCast.cpp
Line:INTEGER:339
Function:CHARACTER:SqlTypeCast::evaluate
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2521
Text:CHARACTER:Error casting from %3 to %4
Insert
Type:INTEGER:5
Text:CHARACTER:com.msg.DBOperations.DatabaseInsert.Main
Insert
Type:INTEGER:5
Text:CHARACTER:14.11
Insert
Type:INTEGER:5
Text:CHARACTER:'bk101'
Insert
Type:INTEGER:5
Text:CHARACTER:INTEGER
ConversionException
File:CHARACTER:F:\build\S610_P\src\CommonServices\ImbUtility.cpp
Line:INTEGER:436
Function:CHARACTER:imbWcsToInt64
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2595
Text:CHARACTER:Invalid characters
Insert
Type:INTEGER:5
Text:CHARACTER:bk101
|
Please alert me if missing any simple thing.
Thanks in Advance. [/quote][/code] |
|
Back to top |
|
 |
kash3338 |
Posted: Fri Jun 08, 2012 10:33 pm Post subject: Re: Invalid characters |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
cvag wrote: |
Please alert me if missing any simple thing. |
Looks like you are casting a Character to Integer. In input you have id as 'bk102' but you are casting to Integer. |
|
Back to top |
|
 |
cvag |
Posted: Fri Jun 08, 2012 11:10 pm Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Thanks a lot Kash,
But after removing CAST, i encountered with another XML error
Error: Unexpected XML type at this point in document
Quote: |
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:957
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_1
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbComputeNode.cpp
Line:INTEGER:464
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_3
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.DB_Insert
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
Line:INTEGER:602
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_3
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.DB_Insert
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:com.msg.DBOperations.DatabaseInsert.Main
Insert
Type:INTEGER:5
Text:CHARACTER:14.4
Insert
Type:INTEGER:5
Text:CHARACTER:INSERT INTO Database.SAMPLE.DETAILS ( NO, NAME, TITLE, GENRE, PRICE, DATE, DESCRIPTION, TOTAL_DATA ) VALUES (inpRef.book[i].(XMLNSC.Attribute)id, inpRef.book[i].(XMLNSC.Field)author, inpRef.book[i].(XMLNSC.Field)title, inpRef.book[i].(XMLNSC.Field)genre, CAST(inpRef.book[i].(XMLNSC.Field)price AS DECIMAL), CAST(inpRef.book[i].(XMLNSC.Field)publish_date AS DATE), inpRef.book[i].(XMLNSC.Field)description, ASBITSTREAM(inpRef.book[i] ENCODING InputRoot.Properties.Encoding CCSID InputRoot.Properties.CodedCharSetId) )
ParserException
File:CHARACTER:F:\build\S610_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCParser.cpp
Line:INTEGER:737
Function:CHARACTER:ImbXMLNSCParser::refreshBitStreamFromElementsCommon
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:com/msg/DBOperations/DatabaseInsert#FCMComposite_1_1
Label:CHARACTER:com.msg.DBOperations.DatabaseInsert.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5010
Text:CHARACTER:XML Writing Errors have occurred
ParserException
File:CHARACTER:F:\build\S610_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCWriter.cpp
Line:INTEGER:880
Function:CHARACTER:ImbXMLNSCWriter::writeMisc
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5016
Text:CHARACTER:Unexpected XML type at this point in document.
Insert
Type:INTEGER:5
Text:CHARACTER:id[bk101]
Insert
Type:INTEGER:5
Text:CHARACTER:attributeType |
I'm not able to find any invalid structure in my message.
Can you please have a look at my input and suggest.
Thanks again for your help.  |
|
Back to top |
|
 |
kash3338 |
Posted: Sat Jun 09, 2012 2:47 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
cvag wrote: |
INSERT INTO Database.SAMPLE.DETAILS ( NO, NAME, TITLE, GENRE, PRICE, DATE, DESCRIPTION, TOTAL_DATA ) VALUES (inpRef.book[i].(XMLNSC.Attribute)id, inpRef.book[i].(XMLNSC.Field)author, inpRef.book[i].(XMLNSC.Field)title, inpRef.book[i].(XMLNSC.Field)genre, CAST(inpRef.book[i].(XMLNSC.Field)price AS DECIMAL), CAST(inpRef.book[i].(XMLNSC.Field)publish_date AS DATE), inpRef.book[i].(XMLNSC.Field)description, ASBITSTREAM(inpRef.book[i] ENCODING InputRoot.Properties.Encoding CCSID InputRoot.Properties.CodedCharSetId) ) |
What is your DB schema structure and datatype? Check if you are inserting proper data with proper datatype in database.
Why is this done?
Code: |
ASBITSTREAM(inpRef.book[i] ENCODING InputRoot.Properties.Encoding CCSID InputRoot.Properties.CodedCharSetId) |
Why dont you cast to Blob and insert this? |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Jun 09, 2012 3:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
Why is this done?
Code: |
ASBITSTREAM(inpRef.book[i] ENCODING InputRoot.Properties.Encoding CCSID InputRoot.Properties.CodedCharSetId) |
Why dont you cast to Blob and insert this? |
You don't do ASBITSTREAM on a single field. Even if, somehow, you needed to, you would still have to use Options and FolderBitsStream.
But you don't need to do ASBITSTREAM on a single field. You probably don't have to cast as blob either... |
|
Back to top |
|
 |
cvag |
Posted: Sat Jun 09, 2012 4:59 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Thanks Kash and Jeff,
Here my error is due to XML structure, not with DBinsertion..
Quote: |
Text:CHARACTER:Unexpected XML type at this point in document.
Insert
Type:INTEGER:5
Text:CHARACTER:id[bk101]
Insert
Type:INTEGER:5
Text:CHARACTER:attributeType |
Please correct me, if am wrong.
Thanks |
|
Back to top |
|
 |
cvag |
Posted: Sat Jun 09, 2012 5:29 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
This is my DBSchema
Quote: |
CREATE TABLE "SAMPLE "."DETAILS" (
"NO" INTEGER NOT NULL ,
"NAME" CHAR(10) NOT NULL ,
"TITLE" CHAR(10) NOT NULL ,
"GENRE" CHAR(10) NOT NULL ,
"PRICE" DECIMAL(5,0) NOT NULL ,
"DATE" DATE NOT NULL ,
"DESC" VARCHAR(10) NOT NULL ,
"MSG_BODY" BLOB(1048576) LOGGED NOT COMPACT NOT NULL )
IN "USERSPACE1" ; |
|
|
Back to top |
|
 |
mqjeff |
Posted: Sat Jun 09, 2012 6:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
cvag wrote: |
Thanks Kash and Jeff,
Here my error is due to XML structure, not with DBinsertion.. |
No.
It is because you are using ASBITSTREAM. |
|
Back to top |
|
 |
rekarm01 |
Posted: Sat Jun 09, 2012 8:24 am Post subject: Re: Invalid characters |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqjeff wrote: |
You don't do ASBITSTREAM on a single field. Even if, somehow, you needed to, you would still have to use Options and FolderBitsStream. |
inpRef.book[i] is a Folder element, not a single field. ASBITSTREAM is appropriate here; CAST won't work. The ParserException is due to the missing FolderBitStream option.
cvag wrote: |
This is my DBSchema
Code: |
CREATE TABLE "SAMPLE "."DETAILS" (
"NO" INTEGER NOT NULL ,
... |
|
If "NO" is an INTEGER column, it's not possible to insert non-integer values such as 'bk101' an 'bk102'. Removing the explicit CAST just shifted the problem from the ESQL to the database INSERT itself, but the problem is still there. |
|
Back to top |
|
 |
kash3338 |
Posted: Mon Jun 11, 2012 4:47 am Post subject: Re: Invalid characters |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
rekarm01 wrote: |
inpRef.book[i] is a Folder element, not a single field. ASBITSTREAM is appropriate here; CAST won't work. The ParserException is due to the missing FolderBitStream option.
|
Sorry for wrong quote. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|