Sybase

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesSybase

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 25th, 2015, 10:17 AM
digioleg54 digioleg54 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2013
Posts: 5 digioleg54 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 10 sec
Reputation Power: 0
SYBASE cursor for read only become infinite loop

I have simple cursor on sybase 15.03
DECLARE nosponcomplete insensitive CURSOR FOR
SELECT p.ib_proj_id_c,
p.clnt_rgn_id_c,
c.clnt_lgl_n,
rtrim(e.csv_em_last_n) + ', ' + rtrim(e.csv_em_first_n) + ' (' + e.csv_em_title_c + ')'
FROM spd_tproj_ref p,
spd_tproj_prod_xref pp,
csv_tcsv_em_ref e,
spd_tclnt_ref c,
spd_vem_unit_ref eu
WHERE p.ib_proj_id_c = pp.ib_proj_id_c
AND p.clnt_id_c = c.clnt_id_c
AND e.csv_em_id_c = eu.EmployeeID
AND pp.ib_proj_stat_c = 'A'
AND pp.ib_proj_stag_c not in ('L','C','D')
AND p.clnt_spnsr_id_c = e.csv_em_id_c
AND e.phr_em_stat_c = 'T'
AND ISNULL(e.phr_last_work_dz,e.phr_em_end_dz) < dateadd(dd, -16, getdate())
AND p.spd_divsn_id_c & 1 = 1
FOR READ ONLY

This cursoir has 260 records.
But when I get in the loop
while (1=1)
begin
fetch ...into

if @@sqlstatus = 2 break

do some select
do some update

end

This cursor become infinite.
Any idea why this is happened

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesSybase > SYBASE cursor for read only become infinite loop


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap