Unix Technical Forum

Calling an AS400 program using OPENQUERY on SQL Server 2000

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-17-2008, 07:12 AM
=?Utf-8?B?a3lvbmc=?=
 
Posts: n/a
Default Calling an AS400 program using OPENQUERY on SQL Server 2000

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-28-2008, 05:40 AM
Ross Culver
 
Posts: n/a
Default Re: Calling an AS400 program using OPENQUERY on SQL Server 2000

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!



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-28-2008, 05:40 AM
=?Utf-8?B?a3lvbmc=?=
 
Posts: n/a
Default Re: Calling an AS400 program using OPENQUERY on SQL Server 2000

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!

>
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com