|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
EVAL issue |
« View previous topic :: View next topic » |
Author |
Message
|
leo.yue |
Posted: Tue May 30, 2006 11:51 pm Post subject: EVAL issue |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
Here is my code for dynamic set statement
Code: |
CREATE PROCEDURE SetValue(IN Element CHARACTER, IN val CHARACTER) BEGIN
-- for example:
-- Element: Header.Name
-- val: WBI
EVAL('SET OutputRoot.XML.' || Element || '= ' || val || ';');
END; |
But, when parsing val, it generated an exception: "First path element must be a valid correlation name". How can I do for this issue? Thanks a lot. |
|
Back to top |
|
 |
sourdas2 |
Posted: Wed May 31, 2006 1:35 am Post subject: |
|
|
 Voyager
Joined: 21 Apr 2006 Posts: 90 Location: Kolkata,India
|
Modyfy the code
Code: |
EVAL('SET OutputRoot.XML.Sachin = val;'); |
_________________ Thanks and Warm Regards
Sourav |
|
Back to top |
|
 |
sourdas2 |
Posted: Wed May 31, 2006 1:38 am Post subject: |
|
|
 Voyager
Joined: 21 Apr 2006 Posts: 90 Location: Kolkata,India
|
Sorry copy paste mistake previously
the modification code should be
Code: |
EVAL('SET OutputRoot.XML.'||Element||' = val;'); |
_________________ Thanks and Warm Regards
Sourav |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed May 31, 2006 5:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, please don't use EVAL unless absolutely necessary. It's slow.
Code: |
SET OutputRoot.XML.{Eleement} = val; |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|