Six Stars med
Six Stars

Create Database table using Csv inputs

Hello Community,

 

I want to develop job which allows to create Database table using 2 Csv Files as Input.

One file contains the columns and description of the table and the second one contains the data to be inserted.

also the data file don't have the same schema which means that i should handle the file without specifying the schema.

 

Any idea how to do it ?!

1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars med
Six Stars

Re: Create Database table using Csv inputs

Hello,

 

First Thank you for your answers.

For the creation it is OK i handled the file using tJavarow.

To insert data in Oracle DB i followed the process that you suggest, i did the some config, i checked that the Dynamic is authorized for My Oracle DB but i had errors.

 

Please find attached the error of the execution.

 

Thanks,

BR,

Med

5 REPLIES
Twelve Stars TRF
Twelve Stars

Re: Create Database table using Csv inputs

Hi,
Can you share your files description?

TRF
Six Stars med
Six Stars

Re: Create Database table using Csv inputs

Hello,

 

Please find attached an example of file.

 

Thanks,

BR,

Med

Seven Stars

Re: Create Database table using Csv inputs

My suggestion would be to use the schema file(the one with the table info) to generate a create statement query depending on the database. The design can look something like this,

CreateTable.PNG

 

Once the tables are created, you need to define your input file component with a single column and mention the column datatype as dynamic. (this option works only on enterprise edition if I am correct and also requires your first row to be a header to work properly).

Input Component,

Capture2.PNG

Output Component,

output.png

 

This way you can read the input files dynamically without defining the schema and loading it to the table of your choice.

 

Please note that the dynamic datatype is not supported for all source and target components. You may want to look for an alternate approach if your job involves complex transformations while loading the data.

Six Stars med
Six Stars

Re: Create Database table using Csv inputs

Hello,

 

First Thank you for your answers.

For the creation it is OK i handled the file using tJavarow.

To insert data in Oracle DB i followed the process that you suggest, i did the some config, i checked that the Dynamic is authorized for My Oracle DB but i had errors.

 

Please find attached the error of the execution.

 

Thanks,

BR,

Med

Six Stars med
Six Stars

Re: Create Database table using Csv inputs

 

 

I found the error thank you.