Hi everyone,
is there anyway I can write a sql statement in a Datastage Basic routine?
wirting a basic routine to run sql
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Of course you can write one.
But what do you want to do with it then?
If it's "UniVerse" SQL you can execute it directly, via DSExecute.
If it's not, you can write it to a file as others have noted, then invoke some kind of script to execute it.
Another possibility is to write a routine that is an ODBC client, using a library of functions collectively called the BASIC SQL Client Interface (BCI). However, to use this on a UNIX server you will need to purchase a licensed ODBC driver to connect to the database in question. The drivers supplied with DataStage are licensed only to be used with stages, not with routines.
Search the Forum for more information.
But what do you want to do with it then?
If it's "UniVerse" SQL you can execute it directly, via DSExecute.
If it's not, you can write it to a file as others have noted, then invoke some kind of script to execute it.
Another possibility is to write a routine that is an ODBC client, using a library of functions collectively called the BASIC SQL Client Interface (BCI). However, to use this on a UNIX server you will need to purchase a licensed ODBC driver to connect to the database in question. The drivers supplied with DataStage are licensed only to be used with stages, not with routines.
Search the Forum for more information.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.