how to connect to database using Basic language

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
suri
Participant
Posts: 24
Joined: Tue May 25, 2004 12:17 am
Location: piscataway
Contact:

how to connect to database using Basic language

Post by suri »

Hi,

I had to write a routine to connect to database and pull data for manipulation. Can any one explain me with example how to connect to oracle database using Basic language.

Thanks
Suresh
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yuck! BCI functions, ODBC and the need to buy licensed drivers. :? Do it in a DataStage job instead. Why do you think you "need" to do this in a routine?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: how to connect to database using Basic language

Post by ray.wurlod »

suri wrote:had to
Why?
There's a reason DataStage has the graphical interface, so you don't have to write code unnecessarily.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suri
Participant
Posts: 24
Joined: Tue May 25, 2004 12:17 am
Location: piscataway
Contact:

Post by suri »

Hi Ray,
I have a select which does select with in select on same table and limits the output Values and basing on these values i have set business rules basing on i will populate 60 target columns.

Sel col1,col2,col3 From Table1 for col 4,col5,col6,col7,col8 these columns are refered as Table2, if this statement gives more than 32 write to reject.
Basing on 32 Values we write set of conditions and populate 60 Target columns
Source DataBase is ORACLE.

Thanks
Suri
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

User defined query should be able to do anything you want.
Mamu Kim
martin
Participant
Posts: 67
Joined: Fri Jul 30, 2004 7:19 am
Location: NewJersy

Post by martin »

This has to read every record....its loop ....User defined SQL work for performing loop

Thanks
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you search here there has been code posted which can open an ODBC connect, allocate memory to the SQL statement and then loop through it like cursor in PLSQL. If you cannot find it then I will post some code tonight.
Mamu Kim
suri
Participant
Posts: 24
Joined: Tue May 25, 2004 12:17 am
Location: piscataway
Contact:

Post by suri »

Its great :idea: Then It will be happy weekend for me :lol:

Thankyou
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not really... you'd still have to buy ODBC drivers, unless you already have. The drivers that ship with DataStage are only licensed for use within jobs, not via the BCI functions.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply