Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

why xp_cmdshell can't be created as rpc table?

3 posts in General Discussion Last posting was on 2011-04-27 03:06:58.0Z
Eisen Posted on 2011-04-26 08:43:47.0Z
Sender: 13e.4db67e18.1804289383@sybase.com
From: Eisen
Newsgroups: sybase.public.ase.general
Subject: why xp_cmdshell can't be created as rpc table?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4db685c3.1e4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 26 Apr 2011 01:43:47 -0700
X-Trace: forums-1-dub 1303807427 10.22.241.41 (26 Apr 2011 01:43:47 -0700)
X-Original-Trace: 26 Apr 2011 01:43:47 -0700, 10.22.241.41
Lines: 20
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30132
Article PK: 79359

Dear sirs
Usually I would create rpc table map to a procedure like
--
create existing table rpc_tb(p1 varchar(255) null, p2
varchar(255) null) external procedure at
"server...sp_helpdb"--
This is always works. But today, when I tried as
exec server...xp_cmdshell "ls"
it succesfully returns the correct result. But when I
use--
create existing table xpoutput(cmdstr varchar(255) null)
external procedure at "server...xp_cmdshell"
and use "select * from xpoutput where cmdstr='ls'"
There's no rows returned while I executing
"server...xp_cmdshell 'ls'" ,the return result is correct. I
don't know what makes the difference. Please give me a hand
on this. Thanks in advance for any help or suggestions.

Best Regards
Eisen


J Posted on 2011-04-26 18:46:27.0Z
From: jtotally_bogus@sbcglobal.net (J)
Newsgroups: sybase.public.ase.general
Subject: Re: why xp_cmdshell can't be created as rpc table?
Reply-To: J@bogusemailAddress.com
Message-ID: <4db7122d.1223306953@forums.sybase.com>
References: <4db685c3.1e4.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 26 Apr 2011 11:46:27 -0700
X-Trace: forums-1-dub 1303843587 10.22.241.152 (26 Apr 2011 11:46:27 -0700)
X-Original-Trace: 26 Apr 2011 11:46:27 -0700, vip152.sybase.com
Lines: 41
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30135
Article PK: 72314

On 26 Apr 2011 01:43:47 -0700, Eisen wrote:

Extended stored procedures are not like other rpc's in that the
xpserver is very specialized and does things like load a particular
dll and then pass parameters to it.

One simple workaround would be to create a "wrapper around the
extended stored procedure" and then create the proxy on that.

e.g.
1> create proc cmdls as exec xp_cmdshell "ls"

then

1> create existing table xpoutput (cmdstr varchar(255) null) external
procedure
at "loopback.master.dbo.cmdls"

Jay

>Dear sirs
> Usually I would create rpc table map to a procedure like
>--
> create existing table rpc_tb(p1 varchar(255) null, p2
>varchar(255) null) external procedure at
>"server...sp_helpdb"--
> This is always works. But today, when I tried as
> exec server...xp_cmdshell "ls"
> it succesfully returns the correct result. But when I
>use--
> create existing table xpoutput(cmdstr varchar(255) null)
>external procedure at "server...xp_cmdshell"
> and use "select * from xpoutput where cmdstr='ls'"
>There's no rows returned while I executing
>"server...xp_cmdshell 'ls'" ,the return result is correct. I
>don't know what makes the difference. Please give me a hand
>on this. Thanks in advance for any help or suggestions.
>
>Best Regards
>Eisen


Eisen Posted on 2011-04-27 03:06:58.0Z
Sender: 13e.4db67e18.1804289383@sybase.com
From: Eisen
Newsgroups: sybase.public.ase.general
Subject: Re: why xp_cmdshell can't be created as rpc table?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4db78852.2682.1681692777@sybase.com>
References: <4db7122d.1223306953@forums.sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 26 Apr 2011 20:06:58 -0700
X-Trace: forums-1-dub 1303873618 10.22.241.41 (26 Apr 2011 20:06:58 -0700)
X-Original-Trace: 26 Apr 2011 20:06:58 -0700, 10.22.241.41
Lines: 48
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30141
Article PK: 72320

Hi, Jay
Thank you very much. It works. Thanks again.

Best Regards
Eisen

> On 26 Apr 2011 01:43:47 -0700, Eisen wrote:
>
> Extended stored procedures are not like other rpc's in
> that the xpserver is very specialized and does things like
> load a particular dll and then pass parameters to it.
>
> One simple workaround would be to create a "wrapper around
> the extended stored procedure" and then create the proxy
> on that.
>
> e.g.
> 1> create proc cmdls as exec xp_cmdshell "ls"
>
> then
>
> 1> create existing table xpoutput (cmdstr varchar(255)
> null) external procedure
> at "loopback.master.dbo.cmdls"
>
> Jay
>
> >Dear sirs
> > Usually I would create rpc table map to a procedure
> like >--
> > create existing table rpc_tb(p1 varchar(255) null, p2
> >varchar(255) null) external procedure at
> >"server...sp_helpdb"--
> > This is always works. But today, when I tried as
> > exec server...xp_cmdshell "ls"
> > it succesfully returns the correct result. But when I
> >use--
> > create existing table xpoutput(cmdstr varchar(255)
> null) >external procedure at "server...xp_cmdshell"
> > and use "select * from xpoutput where cmdstr='ls'"
> >There's no rows returned while I executing
> >"server...xp_cmdshell 'ls'" ,the return result is
> correct. I >don't know what makes the difference. Please
> give me a hand >on this. Thanks in advance for any help or
> suggestions. >
> >Best Regards
> >Eisen
>