?
Solved

Executing prepared statement in procedure

Posted on 1999-01-19
1
Medium Priority
?
465 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 600 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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