October 21, 2005 at 1:13 pm
Heh, I've searched and searched and searched...
-- Stephen Cook
October 21, 2005 at 1:20 pm
Sorry, the link wasn't has obvious as I thaught it would be. I can't be certain that this will solve your problem but since the guy hasn't requested more help I can hope it will...
http://qa.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=229715&P=2#bm230311
December 4, 2006 at 9:07 am
declare cursor_name cursor
for select parameter from table_name
for update
declare @parameter varchar(35) /* example*/
declare @counter int
open cursor_name
set @counter = 1
while @counter <= 6 /* how many rows*/
begin
fetch next from cursor_name into @parameter
update table_name set parameter = substring(@parameter,2,3) + substring(@parameter,6,35) where current of cursor_name /* example */
print @parameter /* show your result */
set @counter = @counter + 1
end
print 'finish'
close cursor_name
deallocate cursor_name
December 4, 2006 at 9:09 am
means that
no want to read_only or forward_only after declare cursor_name cursor
December 5, 2006 at 12:07 pm
I don't have a READ_ONLY or FORWARD_ONLY in there (the cursor declaration is in the first page of this thread). There is something else going on here.
I had all but forgotten about this (until I got the email saying the thread was posted to again), apparently nobody cares if this is a slow report. It still bugs me deep down inside but I'm not going to lose sleep over it.
-- Stephen Cook
December 5, 2006 at 2:21 pm
DECLARE csr CURSOR SCROLL DYNAMIC SCROLL_LOCKS FOR
SELECT PCPLastName,
PCPFirstName,
PCP_MI_Title,
PAGE
FROM AuthFormData
ORDER BY PCPLastName,
PCPFirstName,
PCP_MI_Title,
LastName,
FirstName,
MI
FOR UPDATE OF PAGE
just put specify everything you need. Usually, the defaults are the first option. In this case, [ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ], READ_ONLY may be the default.
March 27, 2007 at 3:14 pm
I faced the same problem. My table had a single column index (it was the only idx on that table, no primary keys..nothing..). I removed that index and made it a primary key and voila!
However, my cursor was not even referencing the field in question in the first place. Anyways, it works now so I am happy . Hope this works for you guys as well!
March 28, 2007 at 12:27 pm
Hi,
I think almost everything can be solved without a cursor, but only for give an answer to your question, try without ORDER BY... that is the reason.
Regards, an sorry my English...
Liliana (ARG).
May 24, 2007 at 2:03 am
Hi
withought the ORDER BY WORKED FOR ME TOO!!!
any idea why?
thnaks in advance
peleg
Viewing 9 posts - 16 through 23 (of 23 total)
You must be logged in to reply to this topic. Login to reply