Solved

Executing prepared statement in procedure

Posted on 1999-01-19
1
408 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
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A safe way to clean winsxs folder from your windows server 2008 R2 editions
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now