473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

how to get parameter value from dynamic select statement ?

Hi,

running DB2 UDB 7.2 F.P 12 on WIndows

Developers debug old application
and need to get value passed to db2 by application

I run db2cli trace and event monitor and both cases I get

SELECT T1.* FROM
UCIT.UPS_INVOIC
MSG T1, UCIT. UPS_MSG_PRICEGRP
T2, UCIT.UPS_PRICE_CUST_GRP T3
WHERE .T1.MSG_NUM = T2.MSG_NUM AND.T2.TYPE = 'I'
AND.T2.GROUP_NAME = T3.GROUP_NA ME AND.T3.CUSTOMER_NUMBER = ?
AND T1.EFFECTIVE_TS <= ? AND T1.EXPIRATION_TS >= ?

I need values to get values of T1.EFFECTIVE_TS <= ? AND
T1.EXPIRATION_TS

Nov 12 '05 #1
2 2604
t2***@hotmail.com wrote:
Hi,

running DB2 UDB 7.2 F.P 12 on WIndows

Developers debug old application
and need to get value passed to db2 by application

I run db2cli trace and event monitor and both cases I get

SELECT T1.* FROM
UCIT.UPS_INVOIC
MSG T1, UCIT. UPS_MSG_PRICEGRP
T2, UCIT.UPS_PRICE_CUST_GRP T3
WHERE .T1.MSG_NUM = T2.MSG_NUM AND.T2.TYPE = 'I'
AND.T2.GROUP_NAME = T3.GROUP_NA ME AND.T3.CUSTOMER_NUMBER = ?
AND T1.EFFECTIVE_TS <= ? AND T1.EXPIRATION_TS >= ?

I need values to get values of T1.EFFECTIVE_TS <= ? AND
T1.EXPIRATION_TS


This statement is run through SQLPrepare(), right? The result is a
statement handle ("hstmt" in the CLI trace). You should see a few
SQLBindParameter() calls following that and then a SQLExecute(). Have a
look at the stuff in the SQLExecute as it should tell you the actual
parameters used for the execution of the statement.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #2
the is no SQLExecute

only SQLBindParameter and SQLExecDirectW
SQLBindParameter( hStmt=2:2, iPar=1, fParamType=SQL_PARAM_INPUT,
fCType=SQL_C_CHAR, fSQLType=SQL_VARCHAR, cbColDef=128, ibScale=0,
rgbValue=&01c755c8, cbValueMax=128, pcbValue=&00c12ecc )
---> Time elapsed - +3.770000E-004 seconds

SQLBindParameter( )
<--- SQL_SUCCESS Time elapsed - +3.856000E-003 seconds

SQLBindParameter( hStmt=2:2, iPar=2, fParamType=SQL_PARAM_INPUT,
fCType=SQL_C_CHAR, fSQLType=SQL_VARCHAR, cbColDef=128, ibScale=0,
rgbValue=&01c76d18, cbValueMax=128, pcbValue=&01c75484 )
---> Time elapsed - +3.490000E-004 seconds

SQLBindParameter( )
<--- SQL_SUCCESS Time elapsed - +3.862000E-003 seconds

SQLBindParameter( hStmt=2:2, iPar=3, fParamType=SQL_PARAM_INPUT,
fCType=SQL_C_CHAR, fSQLType=SQL_VARCHAR, cbColDef=128, ibScale=0,
rgbValue=&01c779d0, cbValueMax=128, pcbValue=&01c754dc )
---> Time elapsed - +3.340000E-004 seconds

SQLBindParameter( )
<--- SQL_SUCCESS Time elapsed - +4.019000E-003 seconds

SQLExecDirectW( hStmt=2:2, pszSqlStr="SELECT T1.* FROM
UCIT.UPS_INVOICE_MSG T1, UCIT.UPS_MSG_PRICEGRP T2,
UCIT.UPS_PRICE_CUST_GRP T3 WHERE T1.MSG_NUM = T2.MSG_NUM AND T2.TYPE =
'I' AND T2.GROUP_NAME = T3.GROUP_NAME AND T3.CUSTOMER_NUMBER = ? AND
T1.EFFECTIVE_TS <= ? AND T1.EXPIRATION_TS >= ?" -
X"530045004C004500430054002000540031002E002A002000 460052004F004D00200055004300490054002E005500500053 005F0049004E0056004F004900430045005F004D0053004700 2000540031002C002000200055004300490054002E00550050 0053005F004D00530047005F00500052004900430045004700 520050002000540032002C00200055004300490054002E0055 00500053005F00500052004900430045005F00430055005300 54005F00470052005000200054003300200057004800450052 00450020000900540031002E004D00530047005F004E005500 4D0020003D002000540032002E004D00530047005F004E0055 004D00200041004E0044000900540032002E00540059005000 450020003D002000270049002700200041004E004400090054 0032002E00470052004F00550050005F004E0041004D004500 20003D002000540033002E00470052004F00550050005F004E 0041004D004500200041004E0044000900540033002E004300 5500530054004F004D00450052005F004E0055004D00420045 00520020003D0020003F00200041004E004400200054003100 2E004500460046004500430054004900560045005F00540053 0020003C003D0020003F00200041004E004400200054003100 2E00450058005000490052004100540049004F004E005F0054 00530020003E003D0020003F00",
cbSqlStr=256 )
---> Time elapsed - +3.530000E-004 seconds
( StmtOut="SELECT T1.* FROM UCIT.UPS_INVOICE_MSG T1,
UCIT.UPS_MSG_PRICEGRP T2, UCIT.UPS_PRICE_CUST_GRP T3 WHERE T1.MSG_NUM
= T2.MSG_NUM AND T2.TYPE = 'I' AND T2.GROUP_NAME = T3.GROUP_NAME AND
T3.CUSTOMER_NUMBER = ? AND T1.EFFECTIVE_TS <= ? AND T1.EXPIRATION_TS >=
?" )

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Berend | last post by:
I am trying to pass multi values into a where clause with an in clause in a store procedure to use in a Crystal report. This can change depending on the user. Maybe there is another way to pass...
4
by: Robert Scheer | last post by:
Hi. I have a stored procedure on a Oracle 8.1.6 database that generates a dynamic sql statement. This stored procedure has an output parameter that needs to return a count from a view. I can...
4
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting...
10
by: Tracy | last post by:
Dear all, I have encountered a problem in passing a VARCHAR parameter (which is a list of accepted values) to the IN predicate of a DB2 user-defined function. For example, I have a table...
9
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio...
0
by: bughunter | last post by:
I found code from java - real bug with secondary parameter, should be Integer but called with String, But procedure completed without any errors and parameter correctly transformed to integer! ...
3
by: JJ | last post by:
When running an sql stored procedure, is it possible to pass in the sortexpression as a parameter? When I try it all the other parameters operate as expected, but the rows are not sorted. The...
0
by: Mark C. Stock | last post by:
"Mark C. Stock" <mcstockX@Xenquery .comwrote in message news:... | | "Berend" <Berend.Brinkhuis@evatone.comwrote in message | news:bdd9ac20.0401271301.22cdb65e@posting.google.com... | | I am...
14
by: bill | last post by:
Can someone please show me an example of passing a string value into an sql statement in vb 2005? Something like this is what I'm after: Dim sqlButton1 As String = "Select * from tblAssets where...
5
by: Trevisc | last post by:
Happy Thursday Everyone, I am trying to create a parameter that is one long varchar but that will be used in a SQL statement IN function: //string queryString = GetCurrentTitles(); //Below is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.