| Author | Message | 
		
		  | kiran_mvr | 
			  
				|  Posted: Tue May 03, 2005 6:12 am    Post subject: How to capture a NEXTVAL from Database |   |  | 
		
		  | Apprentice
 
 
 Joined: 12 Dec 2004Posts: 35
 
 
 | 
			  
				| Hai all, 
 my task i need to get the NEXTVAL from database, for that i have written a sequence on one table in oracle9i. The Sequence is working fine in Oracle,But when iam using this in MessageBroker  this is giving a problem .
 
 My code is like...
 
 SET Environment.iBatchNo[]=PASSTHRU('SELECT.BATCH_SEQ.NEXTVAL FROM DUAL');
 
 SET iBatchNo=Environment.iBatchNo[];
 
 
 Please Help with this issue.
 _________________
 Kiran_manny
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jefflowrey | 
			  
				|  Posted: Tue May 03, 2005 6:17 am    Post subject: |   |  | 
		
		  | Grand Poobah
 
 
 Joined: 16 Oct 2002Posts: 19981
 
 
 | 
			  
				| I think you want THE and ITEM. _________________
 I am *not* the model of the modern major general.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | malammik | 
			  
				|  Posted: Tue May 03, 2005 6:24 am    Post subject: |   |  | 
		
		  |  Partisan
 
 
 Joined: 27 Jan 2005Posts: 397
 Location: Philadelphia, PA
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kiran_mvr | 
			  
				|  Posted: Tue May 03, 2005 7:13 am    Post subject: problem with Database Sequence in MB |   |  | 
		
		  | Apprentice
 
 
 Joined: 12 Dec 2004Posts: 35
 
 
 | 
			  
				| Hai , 
 When iam trying with the Code which you sent,i am getting error.
 
 CODE: SET Environment.iBatchNo=THE(SELECT SEQUENCE.NEXTVAL FROM Database.BATCH_SEQ AS SEQUENCE);
 
 DataBaseERROR:Sequence not allowed here..
 _________________
 Kiran_manny
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | malammik | 
			  
				|  Posted: Tue May 03, 2005 7:17 am    Post subject: |   |  | 
		
		  |  Partisan
 
 
 Joined: 27 Jan 2005Posts: 397
 Location: Philadelphia, PA
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | dipankar | 
			  
				|  Posted: Wed May 04, 2005 4:36 am    Post subject: |   |  | 
		
		  | Disciple
 
 
 Joined: 03 Feb 2005Posts: 171
 
 
 | 
			  
				| Hi Kiran, 
 
 
   
	| Quote: |  
	| SET Environment.iBatchNo[]=PASSTHRU('SELECT.BATCH_SEQ.NEXTVAL FROM DUAL'); |  
 I do not know why you used .BATCH_SEQ. you can use the following ESQL.
 SET Environment.iBatchNo[]=PASSTHRU('SELECT BATCH_SEQ.NEXTVAL FROM DUAL');
 I think it will solve your problem.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |