Author |
Message
|
siva1431202 |
Posted: Sun May 08, 2011 8:33 pm Post subject: Need Support |
|
|
Novice
Joined: 04 May 2011 Posts: 20
|
Hi Could any one please support me with java compute node. i had the following code in esql. How can i write this in Java compute node.this code is for duplicate removal.
DECLARE Y INTEGER;
DECLARE Z INTEGER;
SET Y = 1;
SET Z = CARDINALITY(InputRoot.XMLNSC.Employee.Emp[]);
WHILE Y < Z DO
DECLARE cnt INTEGER;
SET cnt = SELECT COUNT (*) FROM InputRoot.XMLNSC.Employee.Emp[].empid AS I WHERE I.empid = InputRoot.XMLNSC.Employee.Emp[Y].empid ;
IF cnt > 1 THEN
DECLARE ref REFERENCE TO InputRoot.XMLNSC.Employee.Emp[Y].empid;
Detach ref;
--Detach
END IF;
SET Y = Y +1;
END WHILE;
SET OutputRoot.XMLNSC.Employee.Emp = InputRoot.XMLNSC.Employee.Emp;
using empid i am removing duplicates.
In the same way i want to sort using Firstname in java compute node. |
|
Back to top |
|
 |
siva1431202 |
Posted: Sun May 08, 2011 10:14 pm Post subject: |
|
|
Novice
Joined: 04 May 2011 Posts: 20
|
Is anone there to help me out of this? |
|
Back to top |
|
 |
Mr Butcher |
Posted: Sun May 08, 2011 10:25 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
This is not a IBM MQ support site. We are all volunteers here having our jobs to do or, even if not at job, still other hobbies to do or family or whatever. In addition, to me it looks like you are looking for free consultant work here. Please keep in mind that there are people making their living of the knowledge you request here (impatiend) for free.
just my 2 cents. _________________ Regards, Butcher |
|
Back to top |
|
 |
siva1431202 |
Posted: Sun May 08, 2011 10:58 pm Post subject: |
|
|
Novice
Joined: 04 May 2011 Posts: 20
|
ok not a problem. i am asking to share the knowledge that's it but i am just asking if possible help me in changing the syntax. I had the logic with me and i am asking just the syntax. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon May 09, 2011 1:40 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
well, most programming languages have some kind of documentation that holds the syntax.  _________________ Regards, Butcher |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 09, 2011 1:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You would use Xpath expressions instead of the ESQL Select statement.
Please also note that your ESQL as written is not terribly well written ESQL.
If you are looking to switch to using Java to increase the performance, you could increase the performance instead by switching to using REFERENCE variables and not using CARDINALITY or [Y] expressions. |
|
Back to top |
|
 |
siva1431202 |
Posted: Mon May 09, 2011 3:41 am Post subject: |
|
|
Novice
Joined: 04 May 2011 Posts: 20
|
Ok . Thank you. Does my ESQL Work? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 09, 2011 4:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
siva1431202 wrote: |
Ok . Thank you. Does my ESQL Work? |
I certainly haven't tested it.
I'm sure if it didn't work, you would know that much better than I do. |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 09, 2011 6:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
siva1431202 wrote: |
Ok . Thank you. Does my ESQL Work? |
I certainly haven't tested it.
I'm sure if it didn't work, you would know that much better than I do. |
Though I can see at least 1 possible problem with it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|