Forum Discussion

kpatnala's avatar
kpatnala
New Contributor
7 years ago

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

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 = [{…},{…},{…}]

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

    • vish's avatar
      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's avatar
        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