Running a SQL from dos command
Moderators: chulett, rschirm, roy
Running a SQL from dos command
Here goes one more stuff.
We can write various sql's and run them in routine using "EXECUTE", but is there a way to run the same command (TCL) at dos prompt by any means?
I gave a thought to this and can think of following options:
1. Write a routine and execute it from DOS Prompt (cant find and way out yet).
2. Write a basic program and then compile it and use the exe (can we produce a exe here) to run the desired sql.
Like to have some suggestions (and if somebody has done anything like this, then his implementation technique) for this problem!
We can write various sql's and run them in routine using "EXECUTE", but is there a way to run the same command (TCL) at dos prompt by any means?
I gave a thought to this and can think of following options:
1. Write a routine and execute it from DOS Prompt (cant find and way out yet).
2. Write a basic program and then compile it and use the exe (can we produce a exe here) to run the desired sql.
Like to have some suggestions (and if somebody has done anything like this, then his implementation technique) for this problem!
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
1. No.
2. No.
Any SQL to be run from the DOS command line would have to be run from a BAT file - DataStage BASIC does not create an "executable" in the operating system sense - all DataStage BASIC code executes within dssh. You can regard dssh as a virtual machine if you like. However, routines can not be executed directly - just as in C they need a "main" program that invokes them. You do not have the tools/skills to construct one of these in the DataStage BASIC environment.
2. No.
Any SQL to be run from the DOS command line would have to be run from a BAT file - DataStage BASIC does not create an "executable" in the operating system sense - all DataStage BASIC code executes within dssh. You can regard dssh as a virtual machine if you like. However, routines can not be executed directly - just as in C they need a "main" program that invokes them. You do not have the tools/skills to construct one of these in the DataStage BASIC environment.
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.
Thanks for help KIM!kduke wrote:It is a little program written by me in VB. They may post source code for something like this in a members only area. If that would be something you might want then ask Dennis the Editor.
i need that code, to understand how that works!if you can provide a way out then it will be a great help!
thanks again!
-
- Premium Member
- Posts: 66
- Joined: Mon Feb 21, 2005 10:40 am
- Location: Paris
Just curious as to why you need to run the sql query from the Dos prompt. If you can describe why you need to do it that way, there may be another solution.
sunil_acc wrote:Thanks for help KIM!kduke wrote:It is a little program written by me in VB. They may post source code for something like this in a members only area. If that would be something you might want then ask Dennis the Editor.
i need that code, to understand how that works!if you can provide a way out then it will be a great help!
thanks again!
CharlesNagy wrote:Just curious as to why you need to run the sql query from the Dos prompt. If you can describe why you need to do it that way, there may be another solution.
sunil_acc wrote:Thanks for help KIM!kduke wrote:It is a little program written by me in VB. They may post source code for something like this in a members only area. If that would be something you might want then ask Dennis the Editor.
i need that code, to understand how that works!if you can provide a way out then it will be a great help!
thanks again!
I want to query DS_JOBS abd DS_ROUTINES to make a list of the jobs and routines in a particular category/project. We have a lot of ways to get the jobs name (dsjob, dssearch) but i am still not aware os any command that can list all the routines (besides querying DS_ROUTINES).
Hop i make my point clear
-
- Premium Member
- Posts: 66
- Joined: Mon Feb 21, 2005 10:40 am
- Location: Paris
Yes, I see what you mean. Bit tricky that. Obtainable readily enough within the Datastage environment, but from outside...
sunil_acc wrote:CharlesNagy wrote:Just curious as to why you need to run the sql query from the Dos prompt. If you can describe why you need to do it that way, there may be another solution.
sunil_acc wrote: Thanks for help KIM!
i need that code, to understand how that works!if you can provide a way out then it will be a great help!
thanks again!
I want to query DS_JOBS abd DS_ROUTINES to make a list of the jobs and routines in a particular category/project. We have a lot of ways to get the jobs name (dsjob, dssearch) but i am still not aware os any command that can list all the routines (besides querying DS_ROUTINES).
Hop i make my point clear
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Attach to project directory and use dssh command to execute DataStage/SQL query (which must be surrounded by double quotes).
Code: Select all
CD C:\Ascential\DataStage\Projects\MyProject
C:\Ascential\DataStage\Engine\bin\dssh "SELECT JOBNO FROM DS_JOBS WHERE NAME = 'MyJob';"
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.