View previous topic :: View next topic
|
Author |
Message |
Kiran Chava
New User
Joined: 07 Jul 2010 Posts: 9 Location: India
|
|
|
|
Hi,
I am trying to insert an xml record into a table column defined as below
NPPES-NPI-IP-DATA-XML USAGE SQL TYPE IS XML AS CLOB(1M).
My XML record is larger than 32Kb. I am getting an error while trying to insert this. Could someone help me understand how we can insert such records into the table.
FYI... We are using Db2 V10 if that might make any difference. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
Are you trying to upload a 32K+ LRECL file from PC to mainframe and then load it into DB2?
If possible post some lines of your XML code with HEX ON mode.
I think the file can be loaded into USS and then FTP'ed to a mainframe PS file with WRAPECORD option. Which will spilt longed records into smaller records based on record separator. |
|
Back to top |
|
|
Kiran Chava
New User
Joined: 07 Jul 2010 Posts: 9 Location: India
|
|
|
|
We are creating an xml using the data from different tables and then inserting that into a new table. below is the part o the xml we are creating.
<nmm:NpiNppesMsg><cod:CodeValue>String</cod:CodeValue></nmm:NpiNppesMsg>
once the xml is ready we are parsing it as below
EXEC SQL SET :NPPES-NPI-IP-DATA-XML =
XMLPARSE(DOCUMENT :WS-XML-RECORD)
END-EXEC.
Then inserting it into the table
EXEC SQL
INSERT INTO NPPES_NPI_IP_FD
( NPI_ID
,NPPES_NPI_IP_DATA_XML
)
VALUES ( :NPI-ID
,:NPPES-NPI-IP-DATA-XML
)
END-EXEC
The fields are defined as below
NPPES_NPI_IP_DATA_XML XML NOT NULL
10 NPPES-NPI-IP-DATA-XML
USAGE SQL TYPE IS XML AS CLOB(1M). |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
I have worked with XML, but not worked with DB2 creating XML jobs. So my assumptions may be wrong.
One possible reason for the error is, the generated XML statement maybe breaking in-between after 32K and flowing into next line. Which causes error during insertion.
Does the XML creation step write the XML statements to a PS file or something? |
|
Back to top |
|
|
Kiran Chava
New User
Joined: 07 Jul 2010 Posts: 9 Location: India
|
|
|
|
The XML is being generated in the same program. we have a join on 4 tables and will be getting the data and generating xml using generate XML command in cobol. The result is to be loaded to a table. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Kiran,
What is the error(SQLCODE's or any abends) you are getting, can you please post that information?
Thanks,
Sushanth |
|
Back to top |
|
|
|