-
passing a variable in a FROM clause
Friday, May 24, 2002
Hi,
I am hoping someone can help me. I am using Sybase 11.9. I am trying to pass a variable in the FROM clause of a SELECT statement. In Microsoft Sql Server 7.0 I can do this as follows:
declare @TABLE_NAME VARCHAR(255),
@MSG VARCHAR(255)
SELECT @TABLE_NAME = 'account'
SELECT @MSG = "SELECT * FROM " + @TABLE_NAME
EXEC (@MSG)
But this does not work for Sybase. Thank you in advance or any help you can give me.
Regards,
David Callaghan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|