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 » Updating database with Broker conneting Java as Front End

Post new topic  Reply to topic
 Updating database with Broker conneting Java as Front End « View previous topic :: View next topic » 
Author Message
yogi
PostPosted: Thu May 26, 2011 1:45 am    Post subject: Updating database with Broker conneting Java as Front End Reply with quote

Apprentice

Joined: 13 Dec 2010
Posts: 35
Location: Pune, India

Code which I have written :

Code:
IF FieldType(inRef.fis:ZoneTime) IS NOT NULL  THEN
         SET outRef.cs:GridColumnName = 'ZoneDateTime';
         -- TODO: Find out what the gridcolumnname is for the attribute.
         SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:ZoneTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');
         
ELSEIF FieldType(inRef.fis:FinalsTime) IS NOT NULL THEN
         SET outRef.cs:GridColumnName = 'FinalsDateTime';
         SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:FinalsTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');
ELSEIF FieldType(inRef.fis.FUEL_REQ_STATUS) IS NOT NULL THEN
      SET outRef.cs.GridColumnName = 'FuelReqStatus';
      SET outRef.cs.NewValue VALUE = CAST(CAST(inRef.fis.FUEL_REQ_STATUS AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');
ELSEIF FieldType(inRef.fis.FUEL_REQUIREMENT) IS NOT NULL THEN
      SET outRef.cs:GridColumnName = 'FuelReq';
      SET outRef.cs.NewValue VALUE = CAST(CAST(inRef.fis.FUEL_REQUIREMENT AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');


For the above code database is updating the first two (ZoneTime, Finals Time) values while we are doing manually but, below two (FUEL_REQ_STATUS, FUEL_REQUIREMENT) fields are not updating. Zone and Finals come under Time column where as FuelReq and FuelReqStaus come under Flight column. Is there any code changes please reply ASAP.


_________________
YoGi
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu May 26, 2011 2:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Maybe you should have used
IF ---- THEN --- END IF constructs instead of
IF ---- THEN ----ELSEIF constructs...?

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu May 26, 2011 4:40 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fjb_saper wrote:
Maybe you should have used
IF ---- THEN --- END IF constructs instead of
IF ---- THEN ----ELSEIF constructs...?




ELSEIF - urgh!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
yogi
PostPosted: Sun May 29, 2011 10:12 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Dec 2010
Posts: 35
Location: Pune, India

Quote:
IF FieldType(inRef.fis:ZoneTime) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'ZoneDateTime';
-- TODO: Find out what the gridcolumnname is for the attribute.
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:ZoneTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:FinalsTime) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'FinalsDateTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:FinalsTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:ActTouchDown) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'LandedDateTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:ActTouchDown AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:ActAirborne) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'AirborneDateTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:ActAirborne AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:AirportOnBlockTime) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'ChksOnDateTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:AirportOnBlockTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:AirportOffBlockTime) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'ChocksOffDateTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:AirportOffBlockTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:FuelReq) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'FuelReq';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:FuelReq AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:FuelReqStatus) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'FuelReqStatus';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:FuelReqStatus AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:FreightWeight) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'FreightWeight';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:FreightWeight AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyyykkmm');

ELSEIF FieldType(inRef.fis:MailWeight) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'MailWeight';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:MailWeight AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:VIP_Flag) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'VIP_Flag';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:VIP_Flag AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:Priority_Flag) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'Priority_Flag';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:Priority_Flag AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:RevisedETA) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'RevisedETA';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:RevisedETA AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:RevisedETD) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'RevisedETD';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:RevisedETD AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:GateStatus) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'GateStatus';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:GateStatus AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:NrTouchdown) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'NrTouchdown';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:NrTouchdown AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:NrApproaches) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'NrApproaches';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:NrApproaches AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:EstimatedOnBlockTime) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'EstimatedOnBlockTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:EstimatedOnBlockTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');

ELSEIF FieldType(inRef.fis:EstimatedOffBlockTime) IS NOT NULL THEN
SET outRef.cs:GridColumnName = 'EstimatedOffBlockTime';
SET outRef.cs:NewValue VALUE = CAST(CAST(inRef.fis:EstimatedOffBlockTime AS GMTTIMESTAMP FORMAT 'I') AS CHAR FORMAT 'ddMMyyyykkmm');
END IF;



whole code used in IF--THEN--ELSEIF, in the above code 1st 6 fields are updating correctly after that nothing is updating.
_________________
YoGi
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 30, 2011 3:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

As each fieldtype is referencing a different field I do not see the point of using ELSEIF.
I would have used a list of IF --- ELSE -- END IF and repeated it for each field you are checking.

Think hard about the logical implications of using ELSEIF in this particular scenario...

In any case, instead of repeating the code I would have created a routine and called it for each field...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
yogi
PostPosted: Tue May 31, 2011 9:39 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Dec 2010
Posts: 35
Location: Pune, India

Quote:
As each fieldtype is referencing a different field I do not see the point of using ELSEIF.
I would have used a list of IF --- ELSE -- END IF and repeated it for each field you are checking.

Think hard about the logical implications of using ELSEIF in this particular scenario...

In any case, instead of repeating the code I would have created a routine and called it for each field...


I am not getting you. can you explain in brief ??
_________________
YoGi
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 01, 2011 2:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

yogi wrote:
Quote:
As each fieldtype is referencing a different field I do not see the point of using ELSEIF.
I would have used a list of IF --- ELSE -- END IF and repeated it for each field you are checking.

Think hard about the logical implications of using ELSEIF in this particular scenario...

In any case, instead of repeating the code I would have created a routine and called it for each field...


I am not getting you. can you explain in brief ??


We're saying, change your code to use IF *only* and not ELSEIF.

You are running into issues because one of your conditions is being satisfied in such a way that it doesn't try any of the other conditions.

And you have written code that says that only ONE Of your conditions should be met, instead of writing code that says that ALL of your conditions COULD be met.
Back to top
View user's profile Send private message
yogi
PostPosted: Wed Jun 01, 2011 9:58 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Dec 2010
Posts: 35
Location: Pune, India

Quote:
And you have written code that says that only ONE Of your conditions should be met, instead of writing code that says that ALL of your conditions COULD be met.


It has to be in the way which I have written, here problem is different. When I am deploying every field is executing except "FuelReq" and "FuelReqStatus".

Error which I was getting : ORA-01747: invalid user.table.column, table.column, or column specification

I have reloaded the execution group then deployed next time I got error : You do not have the privilege to carry out this action.
_________________
YoGi
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Jun 02, 2011 12:32 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

yogi wrote:
Error which I was getting : ORA-01747: invalid user.table.column, table.column, or column specification

It might have been useful to post that a week ago.

Is this error occurring within the posted code, or within unposted code?
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 » Updating database with Broker conneting Java as Front End
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.