Author |
Message
|
Gideon |
Posted: Thu Nov 03, 2011 11:18 am Post subject: ESQL PASSTHRU |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I can get either of the following statements to work:
Code: |
SET OutputLocalEnvironment.Variables.ReturnStmt[] = SELECT * FROM Database.catalog; |
or ...
Code: |
SET myVar = 'SELECT * FROM db2inst1.catalog';
SET OutputLocalEnvironment.Variables.Return = PASSTHRU(myVar); |
The documentation states that PASSTHRU is mostly used for administrative commands
Do most people gather data and use DELETE, UPDATE, INSERT, and SELECT statements without using PASSTHRU
Or would people use PASSTHRU for those statements
Is there any performance considerations to using either method |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 03, 2011 11:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There are a number of common SQL options to SELECT that are not supported by the ESQL select - such as ORDER BY or GROUP BY.
So it is as common to use PASSTHRU instead of SELECT as it is to use an ORDER BY or GROUP BY clause in an SQL Query. |
|
Back to top |
|
 |
Gideon |
Posted: Thu Nov 03, 2011 11:36 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
Is PASSTHRU slower or faster than the normal SELECT method, or is there a difference |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Nov 03, 2011 11:50 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
Gideon wrote: |
Is PASSTHRU slower or faster than the normal SELECT method, or is there a difference |
I guess PASSTHRU is faster, as it take the sql statement directly to the DB and get it executed. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
inMo |
Posted: Mon Nov 07, 2011 11:34 am Post subject: |
|
|
 Master
Joined: 27 Jun 2009 Posts: 216 Location: NY
|
Is your question:
What is PASSTHRU?
-or-
Why isn't my original SELECT code working?
-or-
What's faster? |
|
Back to top |
|
 |
|