Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
AV2022
Contributor
Contributor

Image Overlapping Issue

Hello Team,

I am facing a very strange issue while importing data from Access DB to Oracle DB. Access DB is my source DB and there are two columns in the Source data Column1=NoProcesso (Datatype: Number) Column2=Logo_Image_Data(Data type: Attachment)

I have created a job using the components mentioned in the attached screenshot to export data from Access and Import it into Oracle DB

Below is the code which i have used for tJavaFlex to extract the Logos from the Logo_Image_Data column

Object obj = rs_tDBInput_1.getObject(2);

net.ucanaccess.complex.Attachment[] objArr =((net.ucanaccess.complex.Attachment[])obj);

System.out.println(objArr);

System.out.println(objArr.length);

System.out.println("Error exception");

if (obj != null && objArr.length>0) {

 net.ucanaccess.complex.Attachment att = (((net.ucanaccess.complex.Attachment[])obj)[0]);

 System.err.println("Attachment Name: " + att.getName());

 row2.bytea = att.getData();

 

}

Data import is getting completed successfully without any Data loss, but the issue i am facing currently is Logos are getting Over written from column 2. For example in the source DB, NoProcesso has a value 1 and has Logo Attachment in Logo_Image_Data, and NoProcesso = 2 has no logo attachement, but after the Talend Job get executed successfully and Data import is completely in Oracle DB, NoProcesso=2 is also getting updated with the Logo of NoProcess=1. In short both the NoProcess 1 and 2 is getting updated with same Logo.

I hereby attach the screenshots of all the components and Tmapping i have created for my talend Job.

It will be of great help if someone can help me to Solve this issue.

Thanks

Anand V

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Set the output column is null if no attachment in column 2, change the code a little as below:

 

Object obj = rs_tDBInput_1.getObject(2);

net.ucanaccess.complex.Attachment[] objArr =((net.ucanaccess.complex.Attachment[])obj);

System.out.println(objArr);

System.out.println(objArr.length);

System.out.println("Error exception");

if (obj != null && objArr.length>0) {

 net.ucanaccess.complex.Attachment att = (((net.ucanaccess.complex.Attachment[])obj)[0]);

 System.err.println("Attachment Name: " + att.getName());

 row2.bytea = att.getData();

 

} else{

row2.bytea=null;

}

 

 

Regards

Shong

View solution in original post

3 Replies
Anonymous
Not applicable

Hi

Set the output column is null if no attachment in column 2, change the code a little as below:

 

Object obj = rs_tDBInput_1.getObject(2);

net.ucanaccess.complex.Attachment[] objArr =((net.ucanaccess.complex.Attachment[])obj);

System.out.println(objArr);

System.out.println(objArr.length);

System.out.println("Error exception");

if (obj != null && objArr.length>0) {

 net.ucanaccess.complex.Attachment att = (((net.ucanaccess.complex.Attachment[])obj)[0]);

 System.err.println("Attachment Name: " + att.getName());

 row2.bytea = att.getData();

 

} else{

row2.bytea=null;

}

 

 

Regards

Shong

AV2022
Contributor
Contributor
Author

Hi Shong,

 

Thanks Alot😑 As always you gave me the perfect solution, Image overlapping issue is fixed now. Once Again thank you so much for your help.

 

Thanks

Anand

SallyStory
Contributor
Contributor

Thanks for the solution, you made my day. If you are looking for the best essay writer online then you can go to this official source here you can see many sites with reviews where you can Get More Information find the best writer for your essay writing.