cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to make a generic pipeline Oracle => SQL Server

Christophe
New Contributor II

Hello,
I would like to build a generic pipeline to load data from an Oracle DB to a SQL Server DB.
I have more than 100 queries to load, so I would like to be able to call the pipeline with the Select (from Oracle) and the destination table as parameters.
I already did a pipeline which works well if I have only Varchar in the select.
If I put a timestamp in the select, I get the error โ€œThe conversion from UNKNOWN to UNKNOWN is unsupported.โ€
I there a way to do what I am tring to do ?
Thanks

7 REPLIES 7

mina
Employee
Employee

Hi Christophe, have you tried the Create table if not present option on the Insert snap?
The patterns catalog has an example of going from SqlServer to Snowflake

image

Christophe
New Contributor II

Thanks for your reply.
My select in the Oracle DB is quite complex (multiple joins) so I use a โ€œOracle - Executeโ€.
I donโ€™t know how to implement your proposal.

When I use โ€œCreate table if not presentโ€, all fields are created with the same type and size : VARCHAR(32700)
which is not possible in SQL server :
The size (32700) given to the column โ€˜XXXโ€™ exceeds the maximum allowed for any data type (8000).

You are welcome, Christophe. On the Select snap>Views>add a 2nd output view and connect it with the 2nd input view of the Insert snap. That will create the target table using source datatypes. I havenโ€™t tested SqlServer but it should work. The Execute snap does not expose source ddl as an output. In that case, you could try a Structure or Mapper snap prior to the insert (mapping just one column passing the rest) but you may need to check the data types you got in the target.
Thatโ€™s my 2 cents and I hope more people will share their experiences.

Christophe
New Contributor II

Hello,
Here is what I try :
image
1/ With the โ€œCreate table if not presentโ€ option
Here is what I get :
Unable to create table: โ€œyyyโ€.โ€œxxxโ€
Resolution:
Please make sure the connection, table name, and schema are correct
Reason:
SQL [CREATE TABLE โ€ฆ
โ€œCREATED_DTTMโ€ TIMESTAMP DEFAULT SYSTIMESTAMP NOT NULL,
)
]; The name โ€œSYSTIMESTAMPโ€ is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
So, the โ€œCreate table if not presentโ€ option does not work properly.
2/ Without the โ€œCreate table if not presentโ€ option
It works.

But as my select is not simple as โ€œselect * from Tableโ€, I can not use โ€œOracle - Selectโ€ but โ€œOracle - Executeโ€.
I had โ€œOracle - Executeโ€ => โ€œMapperโ€ => โ€œGeneric JDBC - Insertโ€ and I get the error โ€œThe conversion from UNKNOWN to UNKNOWN is unsupported.โ€
I change to โ€œOracle - Executeโ€ => โ€œMapperโ€ => โ€œSQL Server - Insertโ€ and it is โ€ฆ OK. :+1: