Talend Data Integration – Exception in component tOracleOutput_1java.lang.ArrayIndexOutOfBoundsException: -32703


You are probably seeing this error as you attempt to transfer data with many date values from one Oracle database to another Oracle database using Talend Studio.

Well quick fix (not sure why it works) is to decrease the commit size in your OracleOutput node. The default is 10,000.  I reduced mine to 500.  See illustration below.

Changing Commit In Talend Data Integration

Comments are always welcome.

Advertisements

Leave a comment

Filed under SQL

Talend Data Integration – Exception in component tOracleOutput_1java.sql.SQLException: ORA-01727: numeric precision specifier is out of range (1 to 38)


When you receive an out of range (1 to 38) error while importing from one Oracle DB to another Oracle DB

  1. Go to your tMap
    tMap
  2. Locate Big Decimals and any other precision numeric values.
  3. Be sure to fill in blanks.
  4. Save your job and re-run

Fin (I hope)

Leave a comment

Filed under Sharing Stuff

update DB2 table with values from another table


Situation Text to be written later.

UPDATE TABLE01 T1
SET (T1.FIELD01, T1.FIELD02)
=
(SELECT CROSS_FIELD_01, CROSS_FIELD02
FROM TABLE02 T2
WHERE T2.MATCHING_FIELD = T1.MATCHING_FIELD
)

End of code text

Leave a comment

Filed under Sharing Stuff

Import Data from DB2 to SQL Server 2012


Below are steps that you can take to import data from IBMs DB2 database into SQL Server.  I’m using SQL Server 2012 Express edition.

Figuring this out has been one of the more frustrating tasks for me, so I hope this helps others like me.

Step 1.) Download and install DB2 Data Server Runtime Client (9.7 Fix Pack 4). Found in IBMs download page.

Step 2.) Extract the contents of your download to Program Files / IBM

Extract and paste the folder and it's contents under Program Files /IBM

Extract and paste the folder and it’s contents under Program Files /IBM

Step 3.) Open your command prompt (as Administrator).  Navigate to the “bin” folder under that folder you just copied into your directory.

Type db2oreg1 -i then type db2oreg1 -setup

Registering and setting up your DB2 ODBC Driver in Windows

Registering and setting up your DB2 ODBC Driver in Windows

Step 4.) Open up SQL Server Management Studio.  Right click on the database that you want to import DB2 data into

Right click on database name, select Tasks, select Data Import

Right click on database name, select Tasks, select Data Import

Step 5.) Select the proper driver for DB2

Select the DB2 Driver that you need to connect to the database

Select the DB2 Driver that you need to connect to the database

Step 6.) Set the connection properties to your DB2 database

Set DB2 Connection properties and test connection

Set DB2 Connection properties and test connection

Step 7 .)  Proceed with the wizard (Write a query to extract data or copy a table).  I chose to write a query.

Copy a table or write a query

Step 8.) Preview mapping of query or table copy

Destination attribute types based on SQL evaluation of values from query

Destination attribute types based on SQL evaluation of values from query

Step 9). Success!

Successful Transfer from DB2 to SQL Server 2012

If you experience any problems and would like some help, please be as specific as possible with regards to the steps you took to get where you are.

 

Best wishes!

Leave a comment

Filed under Computer - Technical, SQL

Find the difference between to Time fields DB2


Whether you have a character field holding time data (e.g. 10:45 PM) or you an actual time field (i.e. 10:45:00) and you want to find out the difference in minutes or hours between the two, you probably already know that you cannot use timestampdiff(), not without some modifications anyway.

In order to successfully extract the time difference, you need to convert your time into a timestamp. If the times we are comparing are in the same day, then you can use the current date. Example:

select timestampdiff(4,char(
timestamp(cast(current date as varchar(10)) || '-' || cast(cast('10:50 PM' as time) as varchar(10)))
-
timestamp(cast(current date as varchar(10)) || '-' || cast(cast('10:50 AM' as time) as varchar(10)))
)) AS MINUTES
from sysibm.sysdummy1

If you already have a date field with either an actual date only value or a character field with a date formatted YYYY-MM-DD, then you can replace “current date” with that date field value. Provided your field holding “time” properly casts into a time value, you can replace the string values (’10:50 PM’, ’10:50 AM’) with your time fields.

If your comparing the min and max of one or more fields, you can simply change the above to:

select timestampdiff(4,char(
max(timestamp(cast(current date as varchar(10)) || '-' || cast(cast(tbl.field as time) as varchar(10))))
-
min(timestamp(cast(current date as varchar(10)) || '-' || cast(cast(tbl.field as time) as varchar(10))))
)) AS MINUTES
from tbl

Comments and questions are welcome. 🙂

Leave a comment

Filed under Sharing Stuff

DB2 UPDATE with INNER JOINS


Unlike SQL Server, DB2 does not allow joins within its update statement.  For example

UPDATE T1
SET T1.COL1 = 'NEW VALUE'
FROM TABLE01 T1
INNER JOIN TABLE02 T2
  ON T1.KEYCOL = T2.KEYCOL
INNER JOIN TABLE03 T3
  ON T2.KEY2COL = T3.KEYCOL
WHERE T1.COL2 = 'SOME VALUE'

To accomplish the same thing in DB2 you would have to do the following:

UPDATE TABLE01 T
SET T.COL = 'NEW VALUE'
WHERE EXISTS
(
  SELECT *
  FROM TABLE01 T1
  INNER JOIN TABLE02 T2
   ON T1.KEYCOL = T2.KEYCOL
  INNER JOIN TABLE03 T3
   ON T2.KEY2COL = T3.KEYCOL
  WHERE T1.COL2 = 'SOME VALUE'
  AND T.KEYCOL = T1.KEYCOL
)

Essentially you write the query that would produce the rows that you want to update. Nest that query and execute a simple update statement with an EXISTS clause

Leave a comment

Filed under Sharing Stuff

org.apache.xml.serializer.ToXMLSAXHandler incompatible with org.apache.xml.serializer.SerializationHandler


If you are creating a BIRT report and you encounter the following error (org.apache.xml.serializer.ToXMLSAXHandler incompatible with org.apache.xml.serializer.SerializationHandler) in relation to a chart in your BIRT report, simply select the ouput format of your Chart to be PNG in BIRT (as opposed to SVG or any other image type that is causing rendering problems.

 

BIRT Chart Output Format

BIRT Chart Output Format

 

Leave a comment

Filed under Computer - Technical