Customer Portal

Trouble using DB_OUTPUT_TABLE

Comments 6

  • Avatar
    oldforum
    0
    Comment actions Permalink
    Yes, it just works fine for me (Postgresql 8.0.3 and jdbc driver postgresql-8.2dev-500.jdbc3)

    Thanks a lot for your responsivness,

    Franck
  • Avatar
    oldforum
    0
    Comment actions Permalink
    Thanks,

    this works, although I get this message :

    ATTENTION: No metadata obtained for table: "oeccp", using workaround ...

    What does this mean ?
  • Avatar
    oldforum
    0
    Comment actions Permalink
    Hello Franck !

    Overall, it should be possible to directly connect DBInputTable and DBOutputTable.

    Said that, I am not sure, it looks like the metadata extracted by the "select *" query somehow does not match the target table.

    Try two things:
    a) in your SQL query, specify list of fields you are going to extract. Make sure they are in the same order as in the target database.

    b) try to use org.jetel.database.AnalyzeDB utility (or CloverGUI) to extract clover style metadata and use them in this graph.

    If time permits, I will try to investigate it a bit more.

    David.
  • Avatar
    oldforum
    0
    Comment actions Permalink
    Hello Franck !

    If you just use "dbTable" attribute/parameter of the DB_OUTPUT_TABLE and specify the name of your output table, Clover will try to assemble its own insert statement based on the input metadata.
    (Leave out "dbFields" and "sqlQuery")

    The problem is that with some databases and JDBC drivers versions this approach might not work.

    David.
  • Avatar
    oldforum
    0
    Comment actions Permalink
    Hello David,

    and thanks for the quick reply !

    I have done what you suggested :

    - run AnalyseDB
    - define metadata using the generated xml file
    - try different select / insert combination

    Result is that metadata with "select * from mytable" works, as well as with an xml file.
    "Select * from mytable" in DB_INPUT_TABLE component is fine too.

    The point is in DB_OUTPUT_TABLE : to make it work, I had to mention each field in dbFields and cloverFields attributes, and to put an SQLCode with as many '?' placeholders. Ommiting dbFields or cloverFields fails.

    Is this expected behaviour or is there is simpler way ? (I just want to duplicate a table, mentionning each field name twice (dbFields, cloverFields) and counting the number of matching '?' is cumbersome...

    Any thought ?

    Franck
  • Avatar
    oldforum
    0
    Comment actions Permalink
    Hello !

    It means that your JDBC driver can't provide metadata for prepared statement - it does not implement this feature. Clover uses its own gues as what column names and types it should use when communicating with DB.

    Most of the time, it should work just fine.

    David.

Please sign in to leave a comment.