| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| beenaj Beginner
 
 
 Joined: 22 Dec 2004
 Posts: 3
 Topics: 1
 
 
 | 
			
				|  Posted: Thu Dec 23, 2004 7:47 am    Post subject: Package set |   |  
				| 
 |  
				| Hi, 
 I have a doubt regarding package set and cursor.
 From my understanding of working of cursors, when open cursor (for a select query)  is performed all the rows selected are available in a view and when we do a fetch, the records are fetched one at a time.
 
 My problem is as follows, I have split tables which needs to be accessed with different qualifiers. I use the Set package set to access the different split tables.
 My first table is not a split table, meaning I can fetch records from the first table using any qualifier. I set the package set to a particular value and select the records. In my fetch loop I have to access another table which is a split table. For accessing this table, I reset the package set, now when i go back to the fetch, it is abending with -501.
 
 To overcome this, I coded one more set package set after the read of the second table with the initial package set value and it is working fine.
 
 Can anyone tell me why -501 is occuring ? Already the rows have been selected and we are just trying to fetch the same.
 
 Is it that the cursor is getting closed when I change the package set ? then how is it getting solved when I again reset it back to original package set ?
 
 Regards,
 BeeJith
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Thu Dec 23, 2004 9:30 am    Post subject: |   |  
				| 
 |  
				| Beenaj, 
 Did the program issue a Syncpoint in between?
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| beenaj Beginner
 
 
 Joined: 22 Dec 2004
 Posts: 3
 Topics: 1
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 1:52 am    Post subject: |   |  
				| 
 |  
				| No there is no syncpoint being issued. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| beenaj Beginner
 
 
 Joined: 22 Dec 2004
 Posts: 3
 Topics: 1
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 1:55 am    Post subject: |   |  
				| 
 |  
				| Kolusu, 
 As an additional info, please note that the code is done using cool:gen, and it is within the Read Each loop that the package set is being set.
 
 Regards,
 beejith
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |