Page 1 of 1

Importing column definition from file

Posted: Mon Jul 30, 2007 10:18 am
by parameswar
Hi,

I have to import column definition from csv file. File structure is given as below:
Column Name,Type,Size,Constraint
ID,Number,10,Primary Key
C_ADDR1,Char,80,
C_ADDR2,Char,80,
C_ADDR3,Char,80,
C_CITY,Char,25,
C_CNTRY,Char,5,

There are 180 columns in this file. Please help me if there is any way to import column definition in manager.

Thanks,
Parameswar

Re: Importing column definition from file

Posted: Mon Jul 30, 2007 1:27 pm
by shivajid2k
Place your file in Datastage server. Login to Datastage manager and goto Import ---> Table definitions-->Sequential file.

Select the filename from directory where you placed that file and import.



dssiva

[quote="parameswar"]Hi,

I have to import column definition from csv file. File structure is given as below:
Column Name,Type,Size,Constraint
ID,Number,10,Primary Key
C_ADDR1,Char,80,
C_ADDR2,Char,80,
C_ADDR3,Char,80,
C_CITY,Char,25,
C_CNTRY,Char,5,

There are 180 columns in this file. Please help me if there is any way to import column definition in manager.

Thanks,
Parameswar[/quote]

hi

Posted: Mon Jul 30, 2007 2:21 pm
by surendra_ds
Hi

Can you paste the error message, it would be use ful to give a solution for your query..

As normal way to import metadata..just follow shivajid2k
steps.

Re: hi

Posted: Tue Jul 31, 2007 12:42 am
by parameswar
surendra_ds wrote:Hi

Can you paste the error message, it would be use ful to give a solution for your query..

As normal way to import metadata..just follow shivajid2k
steps.
Thanks for your reply. Actually I am not getting any error in importing column definition. I am clearly defining the requirement again:
I have the flatfile(test1.txt) which is fixed length record format and having no column name & no delimiter in that file. In another csv file (test2.csv) only column definition is given for the above file test1.txt.

==== test2.csv=========

Column Name,Type,Size,constraint
ID,Number,10,Not Null
Name,Char,25,Not Null
Age,Number,2,Not Null
Filler1,Char,10,
DOB,date,10,
Address,Varchar,50,
Filler2,Char,20,


Since it is fixed length record file(test1.txt), field possition and its order is important. one solution is that I have to type the definition for each column to read the file. But this metod is fully boring if I have more then 100 columns.Is there any other better approach to import the column definition from test2.csv file which can be used to read the file test.txt .


Thanks,
Parameswar

Re: hi

Posted: Tue Jul 31, 2007 1:09 am
by k1980pc
I had to do the same for one of my clients. I ended up writing a macro for creating ddl from the spreadsheet, executed in a temp oracle schema and imported the metadata from there. The number of tables was pretty huge, so it was worth the one time effort :)

PS : The tool was not Datastage, so there might be better options in DS.

Re: hi

Posted: Tue Jul 31, 2007 4:35 am
by parameswar
k1980pc wrote:I had to do the same for one of my clients. I ended up writing a macro for creating ddl from the spreadsheet, executed in a temp oracle schema and imported the metadata from there. The number of tables was pretty huge, so it was worth the one time effort :)

PS : The tool was not Datastage, so there might be better options in DS.
Can somebody help, is there any better approach in Datastage to meet the above requirement.


Regards,
Param

Re: Importing column definition from file

Posted: Tue Jul 31, 2007 5:20 am
by Yuan_Edward
I cann't see there is a direct way to do it, but maybe it is not hard to translate the column definition csv file into a DataStage schema file.
parameswar wrote:Hi,

I have to import column definition from csv file. File structure is given as below:
Column Name,Type,Size,Constraint
ID,Number,10,Primary Key
C_ADDR1,Char,80,
C_ADDR2,Char,80,
C_ADDR3,Char,80,
C_CITY,Char,25,
C_CNTRY,Char,5,

There are 180 columns in this file. Please help me if there is any way to import column definition in manager.

Thanks,
Parameswa