|
-
Dec 20th, 2007, 02:13 PM
#4
Lively Member
Re: Problem In Cursor
 Originally Posted by szlamany
And what is making you think that the CURSOR can be set to a variable string of SQL?
I did this and it worked
Code:
declare c cursor for select * from tcs_t
deallocate c
But this gets a syntax error
Code:
declare @str varchar(100)
set @str='select * from tcs_t'
declare c cursor for @str
deallocate c
You will have to change your logic so that the WHERE clause has OR's and what not...
Learn something new every day!
Also, your if conditions don't append an 'AND' or 'OR' so that won't work as a regular query anyways... I think.
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
|
Click Here to Expand Forum to Full Width
|