Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Calling sql-server osql from rexx

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Calling sql-server osql from rexx
#13256
Posted by: ironcore 2010-03-17 07:32:09
I've used the REXX ODBCc functions to connect and execute queries from a REXX .

I've used osql from perl scripts and I'd like to try it from REXX

I tried using iterateexe('osql -E -Q -d TESTDB -i query.sql -S DEVLSERVER -o out.txt -n')
but I get "Window can't find 'osql...etc'.
I have successfully run the 'osql -E -Q -d TESTDB -i query.sql -S DEVLSERVER -o out.txt -n' from a command window so I know my command string is correct.

Anyone have any ideas what I'm missing?

thanks
cliff:-)
Message2. Not quite sure why you're doing it that way
#13258
Posted by: Michael S 2010-03-17 14:33:49
I use the ODBC code to access an XDB server (we use a product called Mainframe Express to develope colob code on the PC, and its database is XDB sever). I've also used the ODBC code to access DB2 databases on our z/OS mainframe with no problems (plus DB2 Express at home as well as SQLite). Granted, the only database on another system/server is the z/OS one, but in all scenarios I use the standard calls that Jeff has deocumented.
Message3. Calling sql-server osql from rexx
#13259
Posted by: ironcore 2010-03-18 00:13:24
Michael,

I want to try the osql for a couple of reasons.  one it would require a lot less codeing. 
The other is I'm having a problem with running a rexx program from a Window's scheduled task. I'm
getting a authorization error when connecting to a database server. 
I can run the rexx from the command window with no problem. 

Looking at the osql that works it has a '-E'  specified which is for a trusted  connection. I don't see a trusted
connection option for Jeff's OdbcAllocDatabase() command.  I think this is the cause of my authorization
problem since its the only difference I see between the rexx odbc and osql.. 

If there is a way to specify a trusted connection with the rexx odbc conneciton I'd drop the idea of using osql.
cliff:-)
Message4. Calling sql-server osql from rexx
#13260
Posted by: ironcore 2010-03-18 02:30:07
I did find the odbc trusted connection command at site;
http://www.devlist.com/ConnectionStringsPage.aspx

Trusted_Connection=yes
cliff:-)
Message5. Ah, but did it
#13261
Posted by: Michael S 2010-03-18 14:13:06
work after the trusted_connection change ?
Message6. Ah, but did it
#13263
Posted by: ironcore 2010-03-19 01:25:19
nope.  :-(

I don't get it.  Something about the scheduled task running the REXX that is missing.
cliff:-)
Message7. A long shot
#13264
Posted by: Michael S 2010-03-19 15:18:03
but if I compare what you're trying to do with an "equivalent" scenario on the mainframe.

Many installations have something similar to (what we have) RACF. This is an authorization application, but one of the things you can configure it to do is allow a program to be run when it's called from application A, but NOT from application B. Could your access problem be something like that (your command window is A, Rexx is B) ?
Message8. old mainframer
#13265
Posted by: ironcore 2010-03-19 23:17:54
actually I started on the mainframe but now I do both (DB2 and sql-server DBA).  I'm very familiar with RACF but weak in the windows security world.

I like the mainframe because I can find things but windows stashes stuff all over the place.  "click here, click hear,
click here, nope.  ok click here, click here, nope. click here.........."

On of the many nice things about REXX is I can use it on the mainframe and windows.  I've written a ton of stuff for
the mainframe and I'm adding new stuff for the windows side all of the time. I've written a couple of rexx-gui apps to help me manage my sql-servers. 
 I just wish I could figure out this scheduled task thing.   Do you know it there is a authorization for access to
the ODBC drivers?
cliff:-)
Message9.
#13266
Posted by: Jeff Glatt 2010-03-20 05:18:07
Hmmm. Mike could be onto something. Are you running RxLaunch.exe from a command prompt. Maybe the fact that it's a GUI program run from a command prompt is an issue. In that case, try a command prompt version of RxLaunch, called Reginald.exe:

http://home.roadrunner.com/~jgglatt/rexx/reginald.exe
Message10. Another thought
#13267
Posted by: Michael S 2010-03-20 22:10:00 Last edited by: Michael S 2010-03-20 22:10:27 (Total edited 1 time)
Continuing the analogy with RACF. Most (all ?) security systems have a log somewhere that indicates who was being a naughty boy and how. Can you review the log on both machines ?
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-4-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0