Hello,
I want to write directly to a SQL-database in a DS-routine. Does anyone have an example how to do this?
How to write to SQL-database in a routine?
Moderators: chulett, rschirm, roy
How to write to SQL-database in a routine?
Kind regards,
Johannes Drost
Johannes Drost
Which database? The easiest is to use a CALL DSExecute(...) API to run a system command, such as sqlplus, isql, sqlcmd, dbaccess, etc. Just formulate the DML or use an existing script and invoke it using the command line program.
Please don't do this to avoid using an ODBC/OCI stage for loading data. I'm assuming you mean to write a row into some table. If you're loading data as part of the ETL process, stick to using the tool.
Please don't do this to avoid using an ODBC/OCI stage for loading data. I'm assuming you mean to write a row into some table. If you're loading data as part of the ETL process, stick to using the tool.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Doing it from a routine incurs one of two fairly severe penalties. Either the routine executes a shell script (with all the overheads of establishing and managing a new shell and return structure), or the routine uses BCI functions (which involves paying for a Data Direct ODBC licence). Why re-invent the wheel?
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.
How do I handle userID and password for the server the database is on?kcbland wrote:Which database? The easiest is to use a CALL DSExecute(...) API to run a system command, such as sqlplus, isql, sqlcmd, dbaccess, etc. Just formulate the DML or use an existing script and invoke it using the command line program.
Please don't do this to avoid using an ODBC/OCI stage for loading data. I'm assuming you mean to write a row into some table. If you're loading data as part of the ETL process, stick to using the tool.
Kind regards,
Johannes Drost
Johannes Drost
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
However you like. They can be passed (as command line arguments) from DataStage to the shell script, for one example. They could be environment variables (perhaps encrypted) for another example.
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.