ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to capture a NEXTVAL from Database

Post new topic  Reply to topic
 How to capture a NEXTVAL from Database « View previous topic :: View next topic » 
Author Message
kiran_mvr
PostPosted: Tue May 03, 2005 6:12 am    Post subject: How to capture a NEXTVAL from Database Reply with quote

Apprentice

Joined: 12 Dec 2004
Posts: 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
View user's profile Send private message
jefflowrey
PostPosted: Tue May 03, 2005 6:17 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you want THE and ITEM.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
malammik
PostPosted: Tue May 03, 2005 6:24 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

SET Environment.Variables =
THE(SELECT SEQUENCE.NEXT_VAL from Database.MQSI.XPATH_SEQ AS SEQUENCE);

DECLARE XPathId CHAR;
SET XPathId = SUBSTRING(CAST(Environment.Variables.NEXT_VAL AS CHAR) FROM 3 FOR 26);
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
kiran_mvr
PostPosted: Tue May 03, 2005 7:13 am    Post subject: problem with Database Sequence in MB Reply with quote

Apprentice

Joined: 12 Dec 2004
Posts: 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
View user's profile Send private message
malammik
PostPosted: Tue May 03, 2005 7:17 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

My code was designed to worke with DB2 view which generates uniques. You should stick with 'SELECT.BATCH_SEQ.NEXTVAL FROM DUAL' for Oracle. Just plug it into my code for select statement.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
dipankar
PostPosted: Wed May 04, 2005 4:36 am    Post subject: Reply with quote

Disciple

Joined: 03 Feb 2005
Posts: 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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to capture a NEXTVAL from Database
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.