This is a discussion on Calling an AS400 program using OPENQUERY on SQL Server 2000 within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Wanted to know how I would go about calling an as400 program on sq server 2000 using tsql's OPENQUERY ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Wanted to know how I would go about calling an as400 program on sq server 2000 using tsql's OPENQUERY ? I read that in 2000, the program can't return a result nor accept parameters. So I have: OpenQuery(myLinkedAS400Server, 'Call myLib.myProgram') -- results in Incorrect syntax near the keyword 'OPENQUERY'. select 1 from OpenQuery(myLinkedAS400Server, 'Call myLib.myProgram') -- Could not process object 'Call myLib.myProgram'. The OLE DB provider 'MSDASQL' indicates that the object has no columns. Any suggestions? Is it possible? I searched everywhere, but had very little success... Thank you! |
| |||
| I'm not sure what you're trying to do with the Call; however, assuming that you've successfully setup your linked server to the DB2 database on the AS400, a typical select statement would look like this: Select * From OpenQuery(myLinkedAS400Server, 'Select * from DatabaseFile.Table') Ross "kyong" <kyongkwak@newsgroup.nospam> wrote in message news:2C841D20-948B-478F-ABF3-B541922332D2@microsoft.com... > Wanted to know how I would go about calling an as400 program on sq server > 2000 using tsql's OPENQUERY ? > > I read that in 2000, the program can't return a result nor accept > parameters. So I have: > > OpenQuery(myLinkedAS400Server, 'Call myLib.myProgram') > -- results in Incorrect syntax near the keyword 'OPENQUERY'. > > select 1 from OpenQuery(myLinkedAS400Server, 'Call myLib.myProgram') > -- Could not process object 'Call myLib.myProgram'. The OLE DB provider > 'MSDASQL' indicates that the object has no columns. > > Any suggestions? Is it possible? > I searched everywhere, but had very little success... > > Thank you! |
| ||||
| Thanks Ross, but it's not a simple query I'm trying to run. It's a program. I want to trigger a program, which will in turn return a dataset. haven't found a way to call a RPG program. But I gave up and that is that. =) thanks anyway. "Ross Culver" wrote: > I'm not sure what you're trying to do with the Call; however, assuming that > you've successfully setup your linked server to the DB2 database on the > AS400, a typical select statement would look like this: > > Select * > From OpenQuery(myLinkedAS400Server, 'Select * from DatabaseFile.Table') > > Ross > > > "kyong" <kyongkwak@newsgroup.nospam> wrote in message > news:2C841D20-948B-478F-ABF3-B541922332D2@microsoft.com... > > Wanted to know how I would go about calling an as400 program on sq server > > 2000 using tsql's OPENQUERY ? > > > > I read that in 2000, the program can't return a result nor accept > > parameters. So I have: > > > > OpenQuery(myLinkedAS400Server, 'Call myLib.myProgram') > > -- results in Incorrect syntax near the keyword 'OPENQUERY'. > > > > select 1 from OpenQuery(myLinkedAS400Server, 'Call myLib.myProgram') > > -- Could not process object 'Call myLib.myProgram'. The OLE DB provider > > 'MSDASQL' indicates that the object has no columns. > > > > Any suggestions? Is it possible? > > I searched everywhere, but had very little success... > > > > Thank you! > > > |