Groups | Blog | Home
all groups > sql server data mining > november 2003 >

sql server data mining : Cursor update for the temporary table


Derek Shi
11/12/2003 7:27:38 PM
Hi,

I created a cursor for a temporary table. such as :

declare person_cur cursor for
select person_number, provider
from #temp_col
order by person_number

But later, I tried to update the data in the temporary
table, like:

update #temp_col
set provider = 'N'
where current of person_cur

But it pops out that Update/Delete cannot be completed
because the cursor is ready only. I pretty much sure that
the data in the table is not duplicated and the temp
table has the index for the 'person_number'. Does anyone
know what problem it is? I am running on Sybase.

Thanks in advance for help.

Vishal Parkar
11/13/2003 8:23:04 PM
Derek Shi ,

[quoted text, click to view]

This is SQL Server forum might be you get good answer in any of the Sybase forum.

However, If a cursor select contains an aggregations,order by, group by, derived columns then the
cursor is read only/non updateable. You will have to remove order by clause.Once again this is
specific to Ms SQL Server, Im not sure about sybase.

--
- Vishal


AddThis Social Bookmark Button