Page 1 of 1
generating schema file
Posted: Sun Jun 22, 2008 10:42 pm
by getsatish_gk
Hi all,
How to generate schema file definition from oracle tables?.
for ex: i have table with table field information
ie., table_name field start_lenght end_lenght
t1 col1 1 4
t1 col2 5 10
t2 col1 1 2
i need to pickup this info and generate a ds schema file
can any one help with ideas/clues..
Thanks in adv.
Satish
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Posted: Sun Jun 22, 2008 11:06 pm
by Minhajuddin
Create a table definition with the columns for which you want to create a schema file(Or import it from oracle). Open the layout tab in the table definition and click on the "parallel" radio button. This will give you the schema of that table definition. You can copy this and put in a text file to create a schema file.
Posted: Sun Jun 22, 2008 11:19 pm
by getsatish_gk
Hi Minhajuddin,
table name, column name and its lenght are stored in oracle table
i need to dynamically generate the schema file.
table_name field start_lenght end_lenght
t1 col1 1 4
t1 col2 5 10
t2 col1 1 2
Any idea?
![Sad :(](./images/smilies/icon_sad.gif)
Posted: Sun Jun 22, 2008 11:48 pm
by keshav0307
i wrote a VB macro to create a scema file for this type of requirement.
Posted: Mon Jun 23, 2008 12:14 am
by getsatish_gk
cool,
Can we do something within ds?
-Satish
Posted: Mon Jun 23, 2008 1:06 am
by keshav0307
yes, you can write similar code in a trasformer(may be in a routine) stage
Posted: Mon Jun 23, 2008 1:56 am
by getsatish_gk
ds routines?
this is painful
![Mad :x](./images/smilies/icon_mad.gif)
Posted: Mon Jun 23, 2008 4:17 am
by ameyvaidya
Well,
you don't "Have" to write routines... Just proper use of the transformer (Stage variables and the "if... then... else..." statement in the derivations) can get what you want.
Re: generating schema file
Posted: Mon Jun 23, 2008 6:02 am
by ray.wurlod
getsatish_gk wrote:Hi all,
How to generate schema file definition from oracle tables?.
for ex: i have table with table field information
ie., table_name field start_lenght end_lenght
t1 col1 1 4
t1 col2 5 10
t2 col1 1 2
i need to pickup this info and generate a ds schema file
can any one help with ideas/clues..
Thanks in adv.
Satish
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Import table definition from Oracle.
Open table definition.
Go to Layout tab and choose Parallel option.
Right click in background area and save as schema file.
Voila!
Posted: Mon Dec 15, 2008 6:47 pm
by nkln@you
Hi,
you don't "Have" to write routines... Just proper use of the transformer (Stage variables and the "if... then... else..." statement in the derivations) can get what you want.
Could anyone explain the steps involved in above
Hi Keshav
i wrote a VB macro to create a scema file for this type of requirement.
Could you post the VB code here and how to do the same in Transformer
Posted: Mon Dec 15, 2008 9:43 pm
by ray.wurlod
Nothing shown in this thread is a DataStage schema file.
You can save schema files directly from the Table Definition record (in Manager or Designer in versions earlier than 8, in Designer in version 8 or later).