Extractor - data stream iterated only once assertionion error Follow
I would like to iterate over ALL_COLUMNS and get the column name with its data type and then process the ROWS data stream. The reason for this is in my Merge extractor I want to build the static text of the MERGE statement while excluding blob, clob, nclob, bFile, image, and sys.xmltype data types.
I looked at implementing FORMATTER.getTypeName(object, column) but I could only get it to work by supplying the ROW as the object. This has triggered an assertion error. I implemented ROWS to get the data type then again to get the meat of the merge statement.
Is there a way to use getTypeName without ROWS?
Uploaded my merge work in progress [Upload id: 2020_10_25_J878XCAn8o4fAWRh (file: Merge.sql.groovy)]
Please sign in to leave a comment.
Sorry for such slow reply
For anyone who has the same problem:
You may pass null value to getTypeName as object, you'll get column type:
Actually the only case to pass real object to getTypeName is when you work with MongoDB because in MongoDB type is determined by an object and not by a column
In SQLite other, then integer primary key a column can contain multiple data types.
Currently DataGrip can infer type from value only in MongoDB and Couchbase.
If you work with SQLite, you can only get type of a column.
I created a ticket for it https://youtrack.jetbrains.com/issue/DBE-12406
Also you can get Java type of a value: