Solved

Executing prepared statement in procedure

Posted on 1999-01-19
1
450 Views
Last Modified: 2010-05-18
Is there any way to execute a prepared statement in a stored procedure in Sybase 11?  In Microsoft SQL Server, you can do the following in a procedure:

  select @stmt = "select custname from customer"
  execute (@stmt)

I believe that you can do the same in SQL Anywhere, although it might be "execute immediate" instead of just "execute".  Can this be done in Sybase 11?
0
Comment
Question by:jsullivan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
bret earned 150 total points
ID: 1098559
Not in 11.0.x.  In 11.5.x and above, there is a stored procedure called sp_remotesql that can be used to do this.  Do a powersearch for "sp_remotesql" at http://www.dejanews.com to find a full description of how to do this.

A more direct "execute immediate" functionality is planned for the next release (12.0), due out around the middle of the year.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question