Fortunately, I got a chance to work with oracle database migration using SSIS. Below is a peculiar behaviour of SQL Server Integration services. I have connected OLE DB source and connected to a table. Dragged and dropped OLE DB Destination, I need to created new table, clicked “New”.
The syntax for the table got created with a create statement.
CREATE TABLE SQLGenerated (
"Type_RATES_ID" NUMERIC(12),
"Type_RATES_VN" NUMERIC(12),
"_TYPE_ID" NUMERIC(12),
"_RATE_TYPE" VARCHAR(2),
"LENDING_RATE" NUMERIC (7,6),
"HEDGING_MARGIN" NUMERIC (7,6),
"PROFIT_MARGIN" NUMERIC (7,6),
"COMMISSION" NUMERIC (7,6),
"ESTABLISHMENT_COST" NUMERIC (24,8),
"RATE_PERIOD" NUMERIC(6),
"DATE_FIX" DATETIME,
"MOD_USER_ID" NUMERIC(12),
"MOD_TIMESTAMP" DATETIME,
"_ID" NUMERIC(12),
"TOTAL_RATE" NUMERIC (7,6),
"FIXED_AMOUNT" NUMERIC (24,8),
"_AMOUNT" NUMERIC (24,8),
"_TYPE_RATE_DIFF" NUMERIC (7,6),
"MATURITY_DATE" DATETIME,
"_SWITCH_FLAG" NUMERIC(1)
)
On pressing “OK” button, am getting the below error.
ORA-00902: invalid datatype (OraOLEDB)
To resolve this issue,
1. I went back to oracle database
2. Created a script for the source database.
3. Copied the content and pasted it into the create table window.
4. Now it’s working fine.
The problem is due to the data type,
create table OracleGenerated
(
Type_RATES_ID NUMBER(12) not null,
Type_RATES_VN NUMBER(12) not null,
_TYPE_ID NUMBER(12) not null,
_RATE_TYPE CHAR(2),
LENDING_RATE NUMBER(7,6),
HEDGING_MARGIN NUMBER(7,6),
PROFIT_MARGIN NUMBER(7,6),
COMMISSION NUMBER(7,6),
ESTABLISHMENT_COST NUMBER(24,8),
RATE_PERIOD NUMBER(6),
DATE_FIX DATE,
MOD_USER_ID NUMBER(12),
MOD_TIMESTAMP DATE,
_ID NUMBER(12) not null,
TOTAL_RATE NUMBER(7,6),
FIXED_AMOUNT NUMBER(24,8),
_AMOUNT NUMBER(24,8) default 0 not null,
_TYPE_RATE_DIFF NUMBER(7,6) default 0 not null,
MATURITY_DATE DATE,
_SWITCH_FLAG NUMBER(1) default 0,
)
The problem is due to the datatype “Datetime”. SQL Server is generating datetime but oracle is not supporting the same. In turn, we need to modify the data type to “date” type.
Thanks and Regards,
Venkatesan Prabu .J
No comments:
Post a Comment