Hi,
From my job sequence, I need to run a Routine first which will query a SQL server table and then pass the value from this routine into the job that will be run as one of the job parameters.
If it's Oracle I would be calling SQLPLUS from the Routine and using the ExecSH in Unix, but now that this table is in SQL Server(NT) what can I use to achieve the same thing ?
Please help.
Nick
Read value in from SQL Server in Routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use ExecDOS if on a Windows platform.
If you're writing for an unknown platform, then you would be better to create your own before/after subroutine.
If you're writing for an unknown platform, then you would be better to create your own before/after subroutine.
Code: Select all
SUBROUTINE ExecOS(InputArg, ErrorCode)
* Test whether operating system is Windows or UNIX using System(91).
* Command variable included only as an example.
If System(91)
Then
Shell = "DOS"
Command = "DEL"
End
Else
Shell = "UNIX"
Command = "rm -rf"
End
* Execute command and set ErrorCode based on exit status.
* Enclosing InputArg in parentheses prevents side-effects.
Call DSExecute(Shell, (InputArg), Output, ExitStatus)
ErrorCode = ExitStatus
RETURN
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.
No, isql and osql are Windoze only. They come standard with the installation on the server.
You need to be able to run Windoze server commands from the unix box. The typical tools for this are rsh and remsh. It's kind of a security hassle to get a company to agree to enabling a user idea to execute remote commands on one server from the other when you're talking unix and Windoze. Unix to unix is never a problem, but those admins hate unix to Windoze. Once that's done, you'll need to write a script to execute the remsh command giving the exact syntax to run osql on the remote server doing whatever it is you need to do.
Your best option is to use a Server job to just spool the data to a file and then read the file from your routine. That's really clean and simple, but it doesn't give you the nice routine solution you like.
You need to be able to run Windoze server commands from the unix box. The typical tools for this are rsh and remsh. It's kind of a security hassle to get a company to agree to enabling a user idea to execute remote commands on one server from the other when you're talking unix and Windoze. Unix to unix is never a problem, but those admins hate unix to Windoze. Once that's done, you'll need to write a script to execute the remsh command giving the exact syntax to run osql on the remote server doing whatever it is you need to do.
Your best option is to use a Server job to just spool the data to a file and then read the file from your routine. That's really clean and simple, but it doesn't give you the nice routine solution you like.
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