Author |
Message
|
GoodBoy |
Posted: Mon Mar 08, 2004 10:31 am Post subject: ESQL - EVAL Problem |
|
|
 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 |
|
 |
mgk |
Posted: Mon Mar 08, 2004 10:34 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
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
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
GoodBoy |
Posted: Mon Mar 08, 2004 10:50 am Post subject: |
|
|
 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 |
|
 |
Missam |
Posted: Mon Mar 08, 2004 11:15 am Post subject: |
|
|
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 |
|
 |
GoodBoy |
Posted: Mon Mar 08, 2004 12:01 pm Post subject: |
|
|
 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 |
|
 |
Missam |
Posted: Mon Mar 08, 2004 12:42 pm Post subject: |
|
|
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 |
|
 |
GoodBoy |
Posted: Tue Mar 09, 2004 4:04 pm Post subject: |
|
|
 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 |
|
 |
HemavathyRG |
Posted: Tue May 02, 2017 4:36 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Tue May 02, 2017 4:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
A new record - posting on a 13 year old thread.
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
DeadPool |
Posted: Tue May 02, 2017 5:03 am Post subject: |
|
|
Apprentice
Joined: 27 May 2016 Posts: 30
|
Just beat the 11 year old one on mqsisetdbparms! |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 02, 2017 5:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, 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 |
|
 |
HemavathyRG |
Posted: Tue May 02, 2017 6:41 am Post subject: |
|
|
Newbie
Joined: 20 Apr 2016 Posts: 8
|
|
Back to top |
|
 |
Vitor |
Posted: Tue May 02, 2017 6:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, 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 |
|
 |
HemavathyRG |
Posted: Tue May 02, 2017 10:07 pm Post subject: |
|
|
Newbie
Joined: 20 Apr 2016 Posts: 8
|
who ever knows, please update me on this. |
|
Back to top |
|
 |
DeadPool |
Posted: Tue May 02, 2017 11:49 pm Post subject: |
|
|
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 |
|
 |
|