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 IndexWebSphere Message Broker SupportESQL - EVAL Problem

Post new topicReply to topic Goto page 1, 2  Next
ESQL - EVAL Problem View previous topic :: View next topic
Author Message
GoodBoy
PostPosted: Mon Mar 08, 2004 10:31 am Post subject: ESQL - EVAL Problem Reply with quote

Novice

Joined: 19 Jan 2004
Posts: 10

Hi ,

Can anyone help me in making my EVAL statement work?

SET Environment.Schema1 = 'nis_ems';
SET Environment.Schema2 = 'epems';
EVAL ('INSERT INTO Database.' || Environment.Schema2 || '.gopal3("age") VALUES (90);');
EVAL ('INSERT INTO Database.' || Environment.Schema1 || '.gopal3 ("age") VALUES (90);');

The above two EVAL's are working fine. But when I need to have a query with a CHARACTER value , it doesn't work. Like the below one

INSERT INTO Database.nis_ems.gopal3 ("firstname" , "lastname" , "city" , "state", "age") VALUES ('greg', 'Marvel', 'New York', 'NY', 21);

Any Help??

Gopal
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Mar 08, 2004 10:34 am Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1583
Location: IBM Hursley, UK

If all you are trying to do is dynamic DB work, please look up PASSTHRU as it is nuch more efficient than using EVAL for this. Only use EVAL when you have no other choice.


Cheers,
_________________
MGK
IBM Global Blockchain Enablement
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
GoodBoy
PostPosted: Mon Mar 08, 2004 10:50 am Post subject: Reply with quote

Novice

Joined: 19 Jan 2004
Posts: 10

Thanq,

can u through some light on me, how to use PASSTHROUGH for my problem. All I need to do is use schema names dynamically in the SQL query.

gop
Back to top
View user's profile Send private message
Missam
PostPosted: Mon Mar 08, 2004 11:15 am Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

You need to go through ESQL Reference for two things here.

1)See how to use PASSTHRU function on how to work with database objects.
2)EVAL function on how to construct ESQL Statements dynamically.


In your particular scenerio you may need the combination of both.
your ESQL statement should look some thing like this

EVAL('PASSTHRU(INSERT INTO Database.' || Environment.Schema2 || '.gopal3("age") VALUES (90); )');
Back to top
View user's profile Send private message
GoodBoy
PostPosted: Mon Mar 08, 2004 12:01 pm Post subject: Reply with quote

Novice

Joined: 19 Jan 2004
Posts: 10

Sam,

I tried the syntax u suggestd me. The below code didn't insert any record ??


---------------------------------------------
SET Environment.Schema1 = 'nis_ems';
SET Environment.Schema2 = 'epems';


EVAL('PASSTHRU(INSERT INTO Database.' || Environment.Schema2 || '.gopal3("age") VALUES (67); )');
EVAL('PASSTHRU(INSERT INTO Database.' || Environment.Schema1 || '.gopal3("age") VALUES (67); )');
-------------------------------------------------

gop
Back to top
View user's profile Send private message
Missam
PostPosted: Mon Mar 08, 2004 12:42 pm Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

Did u check for any errors recorded to your error log.may be its the problem with connecting to the database.First look into error logs for any specific errors and if possible can you post them here.
And one more thing..Did u added the Corresponding Data Source And Table Name to the input property pane of the compute node.
Back to top
View user's profile Send private message
GoodBoy
PostPosted: Tue Mar 09, 2004 4:04 pm Post subject: Reply with quote

Novice

Joined: 19 Jan 2004
Posts: 10

Thanq sam . The PASSTHRU worked for me to create dynamic querys and access multiple schemas from the same DB node.

Thanq all for ur help
Back to top
View user's profile Send private message
HemavathyRG
PostPosted: Tue May 02, 2017 4:36 am Post subject: Reply with quote

Newbie

Joined: 20 Apr 2016
Posts: 8

Did you get it done only by using PASSTHRU statement.
I need help on the same.
I have a select query and input varies depends on the requirement.
How Do I alter my select query just based on the inputs and get the details from Database.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 02, 2017 4:54 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24452
Location: Ohio, USA

A new record - posting on a 13 year old thread.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
DeadPool
PostPosted: Tue May 02, 2017 5:03 am Post subject: Reply with quote

Apprentice

Joined: 27 May 2016
Posts: 30

Just beat the 11 year old one on mqsisetdbparms!
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 02, 2017 5:21 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24452
Location: Ohio, USA

Never deleting threads from this forum is a bit of a double edged sword.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
HemavathyRG
PostPosted: Tue May 02, 2017 6:41 am Post subject: Reply with quote

Newbie

Joined: 20 Apr 2016
Posts: 8

Any updates....!!!!
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 02, 2017 6:43 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24452
Location: Ohio, USA

HemavathyRG wrote:
Any updates....!!!!


You're expecting updates from someone who hasn't posted here in over 10 years? I admire your optimism.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
HemavathyRG
PostPosted: Tue May 02, 2017 10:07 pm Post subject: Reply with quote

Newbie

Joined: 20 Apr 2016
Posts: 8

who ever knows, please update me on this.
Back to top
View user's profile Send private message
DeadPool
PostPosted: Tue May 02, 2017 11:49 pm Post subject: Reply with quote

Apprentice

Joined: 27 May 2016
Posts: 30

GoodBoy wrote:
Thanq sam . The PASSTHRU worked for me to create dynamic querys and access multiple schemas from the same DB node.

Thanq all for ur help


Does this not answer your question?

Maybe try a few things and maybe even open a new thread as the fact that this is 13 years old kind of makes a mockery of it


Last edited by DeadPool on Wed May 03, 2017 4:43 am; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexWebSphere Message Broker SupportESQL - EVAL Problem
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.