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
Importing column definition from file
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 66
- Joined: Sun Apr 08, 2007 12:34 pm
-
- Participant
- Posts: 19
- Joined: Mon Feb 14, 2005 11:34 pm
Re: Importing column definition from file
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]
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]
-
- Participant
- Posts: 12
- Joined: Wed Apr 19, 2006 7:41 am
hi
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.
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.
-
- Premium Member
- Posts: 66
- Joined: Sun Apr 08, 2007 12:34 pm
Re: hi
Thanks for your reply. Actually I am not getting any error in importing column definition. I am clearly defining the requirement again: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.
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
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.
PS : The tool was not Datastage, so there might be better options in DS.
RELAXEN UND WATSCHEN DER BLINKENLICHTEN
-
- Premium Member
- Posts: 66
- Joined: Sun Apr 08, 2007 12:34 pm
Re: hi
Can somebody help, is there any better approach in Datastage to meet the above requirement.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.
Regards,
Param
-
- Participant
- Posts: 73
- Joined: Tue May 10, 2005 6:21 pm
- Location: Sydney
Re: Importing column definition from file
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
Edward Yuan