I’ve got very simple 1 column table, and that 1 column is defined as CLOB, with no specified length. Far as I know, that means the max length is 2097088000.
I am trying to dump this out to a text file using TPT. I’m confident that each row will be less than 1MB, so I’m trying to do this with the inline method. Here’s the relevant bits of the script:
DEFINE JOB EXPORT_FILTER_FILE
(
DEFINE SCHEMA FILE_SCHEMA
(
clob_col CLOB
);
DEFINE OPERATOR SQL_SELECT
TYPE SELECTOR
SCHEMA FILE_SCHEMA
ATTRIBUTES
(
VARCHAR Tdpid = 'TDInstance',
VARCHAR LogonMech = 'LDAP',
...
VARCHAR SelectStmt = 'select clob_col from db.table;'
);
DEFINE OPERATOR FILE_WRITER
...
APPLY TO OPERATOR (FILE_WRITER)
SELECT * FROM OPERATOR (SQL_SELECT);
);
When I execute this script, I get the following error:
TPT_INFRA: TPT02638: Error: Conflicting data length for column(1) - clob_col.
Source column's data length (64000) Target column's data length (2097088000).
Why does it think the source column’s length is 64k, when it’s defined as a clob?