Long type and blob types at the same time, the court into a problem is derived. Output "has been shut down stream"
source table structure:
create table t1 (c1 blob ,c2 long);
target table structure:
create table t2 (c1 blob ,c2 long);
DB_INPUT_TABLE -> DB_OUTPUT_TABLE
fmt file:
<Record name="T1" type="delimited">
<Field name="C1" type="byte" format="" nullable="true" default="" size="1" length="1" scale="0" delimiter=";"/>
<Field name="C2" type="long" format="" nullable="true" default="" size="2147483647" length="2147483647" scale="0" delimiter="\n"/>
</Record>
source table structure:
create table t1 (c1 blob ,c2 long);
target table structure:
create table t2 (c1 blob ,c2 long);
DB_INPUT_TABLE -> DB_OUTPUT_TABLE
fmt file:
<Record name="T1" type="delimited">
<Field name="C1" type="byte" format="" nullable="true" default="" size="1" length="1" scale="0" delimiter=";"/>
<Field name="C2" type="long" format="" nullable="true" default="" size="2147483647" length="2147483647" scale="0" delimiter="\n"/>
</Record>
-
Hello,
I haven't found any problem on MySql database. Isn't the problem in the metadata? Length and scale can be specified for decimal field only and size shouldn't be specified fro delimited metadata. -
Sorry, my database environment is ORACLE 10g -
Hi,
I thing that problem is in jdbc oracle driver: after calling method getBytes or getBlob can't be called other type call method. I've found workaround to solve your problem: change field's order in metadata and in sql queries - that means:
<Record name="T1" recordSize="-1" type="delimited">
<Field default="" delimiter="\n" format="" name="C2" nullable="true" scale="0" shift="0" type="string"/> - long type in Oracle: Character data of variable length (A bigger version the VARCHAR2 datatype)
<Field default="" delimiter=";" format="" name="C1" nullable="true" scale="0" shift="0" type="byte"/>
</Record>
and sqlQuery in input table:
select c2, c1 from t1
sqlQuery in output table
insert into (c2, c1) values (?,?) -
Thank you very much for the patience to answer, was touched by your professionalism(open sources), this should be oracle jdbc driven bug.
Please sign in to leave a comment.
Comments 4