Click here to Skip to main content
15,916,702 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to select first n characters using stored procedure Pin
Mycroft Holmes9-Apr-09 22:26
professionalMycroft Holmes9-Apr-09 22:26 
GeneralRe: How to select first n characters using stored procedure Pin
Meax10-Apr-09 3:58
Meax10-Apr-09 3:58 
GeneralRe: How to select first n characters using stored procedure Pin
Ramke16-Apr-09 0:05
Ramke16-Apr-09 0:05 
AnswerRe: How to select first n characters using stored procedure Pin
Ashfield12-Apr-09 4:31
Ashfield12-Apr-09 4:31 
QuestionDuplicate Rows Pin
Saiyed Alam9-Apr-09 4:50
Saiyed Alam9-Apr-09 4:50 
AnswerRe: Duplicate Rows Pin
Rob Philpott9-Apr-09 5:25
Rob Philpott9-Apr-09 5:25 
GeneralRe: Duplicate Rows Pin
Saiyed Alam9-Apr-09 6:49
Saiyed Alam9-Apr-09 6:49 
Questioncursor goes in to infinit loop......... Pin
pranavcool9-Apr-09 0:28
pranavcool9-Apr-09 0:28 
hi,
I have written a cursor that goes into infinite loop. I am not able to make out where i have done wrong.

the following is the code.
/******************************************************************************/
declare @dirid int
declare @topic varchar(8000)

create table #topic(Dir_Id int,topic_Id varchar(1000))

insert into #topic(Dir_Id,topic_Id)select D.Dir_Id,D.topicid FROM Category CN
INNER JOIN directory D ON CN.Cat_Id = D.OrgType_Id
INNER JOIN SubCategory SB ON D.Country = SB.SubCat_ID
WHERE CN.Cat_Name = 'Academic'

declare curtopic cursor for
select Dir_Id,topic_Id from #topic
open curtopic
fetch next from curtopic into @dirid,@topic
begin
while @@fetch_status = 0
set @topic = ''
SELECT @topic = topic_Id from #topic
fetch next from curtopic into @dirid,@topic
end
close curtopic
deallocate curtopic
print @topic
drop table #topic

/****************************************************************************/

i want to retrieve the data row by row for which i have written cursor.
but it is going in to infinite loop.


any help would be great full.

regards,
pranav

Pranav Dave

AnswerRe: cursor goes in to infinit loop......... Pin
Rob Philpott9-Apr-09 0:56
Rob Philpott9-Apr-09 0:56 
QuestionCan Predictive Analysis be done in SQL Server 2005? Pin
sunit_828-Apr-09 23:47
sunit_828-Apr-09 23:47 
QuestionHow to intergrate 2 table Pin
cocoonwls8-Apr-09 18:28
cocoonwls8-Apr-09 18:28 
AnswerRe: How to intergrate 2 table Pin
Kevin Horgan8-Apr-09 20:39
Kevin Horgan8-Apr-09 20:39 
GeneralRe: How to intergrate 2 table Pin
cocoonwls8-Apr-09 21:32
cocoonwls8-Apr-09 21:32 
GeneralRe: How to intergrate 2 table Pin
cocoonwls8-Apr-09 21:33
cocoonwls8-Apr-09 21:33 
GeneralRe: How to intergrate 2 table Pin
Kevin Horgan9-Apr-09 8:02
Kevin Horgan9-Apr-09 8:02 
GeneralRe: How to intergrate 2 table Pin
cocoonwls10-Apr-09 0:34
cocoonwls10-Apr-09 0:34 
GeneralRe: How to intergrate 2 table Pin
Kevin Horgan10-Apr-09 1:05
Kevin Horgan10-Apr-09 1:05 
QuestionHow to create encrypted trigger Pin
azad yadav8-Apr-09 17:51
azad yadav8-Apr-09 17:51 
AnswerRe: How to create encrypted trigger Pin
Henry Minute11-Apr-09 2:57
Henry Minute11-Apr-09 2:57 
NewsSQL Server 2008 SP1 Released Pin
brucedkyle8-Apr-09 12:21
brucedkyle8-Apr-09 12:21 
QuestionMicrosoft Access and Record Level Locking [modified] Pin
paas8-Apr-09 10:25
paas8-Apr-09 10:25 
AnswerRe: Microsoft Access and Record Level Locking Pin
Mycroft Holmes8-Apr-09 17:01
professionalMycroft Holmes8-Apr-09 17:01 
GeneralRe: Microsoft Access and Record Level Locking Pin
paas9-Apr-09 1:08
paas9-Apr-09 1:08 
GeneralRe: Microsoft Access and Record Level Locking Pin
Mycroft Holmes9-Apr-09 1:48
professionalMycroft Holmes9-Apr-09 1:48 
GeneralRe: Microsoft Access and Record Level Locking Pin
paas9-Apr-09 2:59
paas9-Apr-09 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.