cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Storing each document into database table.. [xmlformatter --> generic jdbc insert]

kpatnala
New Contributor

Hi,

iโ€™m getting following error when executing โ€œGeneric Jdbc insertโ€ snap.
i have 2 data values that need to be inserted in 2 column table.
mapper gives me col1, col2 each having list of 3 values.
col1 = [a,b,c] and col2 = [{โ€ฆ},{โ€ฆ},{โ€ฆ}]

image

Error:

Unable to construct CREATE TABLE statement

Resolution:

Please provide valid input data.

Reason:

No column value or value of supported column type in the input view

Hide Detailsโ€ฆ

Generic JDBC - Insert[8b34190d-aaef-4b59-9743-ae23ea997132 โ€“ 8b07adcd-0232-4ca0-ac49-6041bbf26870]
com.snaplogic.snap.api.SnapDataException: Unable to construct CREATE TABLE statement

Thanks,
Kiran

3 REPLIES 3

kpatnala
New Contributor

image

vish
Former Employee

Hello Kiran, Could you share the output of the XML formatter as well as a screenshot of the mapper? Most likely, youโ€™d need to use the JSON Splitter snap after to โ€˜flattenโ€™ the data to fit into a relational database. Thanks!

kpatnala
New Contributor

Hi Vish,

Basically I would need the XML go into the database. At XML Formatter snap I can see the output of 3 xml data elements. when I use file writer snap next to XMLformatter, I can create an xml file with complete xml data.
3 elements โ†’ should go as 3 rows in a table

eg:
id=1, data=doc1
id=2, data=doc2
id=3, data=doc3

how would i connect xmlformatter to jdbcinsert for each data in xml?

Thanks,
Kiran