If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL Logging - How do to get parameter values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-07, 12:15
James Frankman James Frankman is offline
Registered User
 
Join Date: Feb 2004
Posts: 24
SQL Logging - How do to get parameter values

I am trying to diagnose some sql problems on DB2 v9.1. I am using the Activity monitor to check for the SQL statements that I am having the problems with. I can get the SQL statement, but it does not show the values passed into the query statement's parameters:

select * from FBNEXUS.FBCLIENTTRANS clienttran0_ inner join FBNEXUS.FB_OFFICES fboffice1_ on clienttran0_.OFFICEID=fboffice1_.ID where fboffice1_.ID=? and clienttran0_.TRANSDATE=?

Is there a way I can get the values for the parameters passed into this query?
Reply With Quote
  #2 (permalink)  
Old 10-16-07, 15:02
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think statement event monitor might provide this information, but I'm not sure.
Reply With Quote
  #3 (permalink)  
Old 10-16-07, 18:06
James Frankman James Frankman is offline
Registered User
 
Join Date: Feb 2004
Posts: 24
I tried to create a statement monitor from the control center. It works, but it does not give me the SQL text let alone the parameter values. There must be some way of doing this. How can I log the SQL statments that get executed on DB2?
Reply With Quote
  #4 (permalink)  
Old 10-17-07, 03:16
ritz ritz is offline
Registered User
 
Join Date: Jan 2005
Posts: 35
Try using the SNAP_GET_DYN_SQL_v91 snapshot.
Reply With Quote
  #5 (permalink)  
Old 10-17-07, 08:05
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by James Frankman
I tried to create a statement monitor from the control center. It works, but it does not give me the SQL text
That probably was a snapshot monitor; what you need is an event monitor.
Reply With Quote
  #6 (permalink)  
Old 10-17-07, 09:48
James Frankman James Frankman is offline
Registered User
 
Join Date: Feb 2004
Posts: 24
I have tried the event monitor for statements. Attached is a screenshot of the output I get. Notice that the '?' marks are still in the query. Is there something else I need to configure to show the parameter values?
Attached Thumbnails
SQL Logging - How do to get parameter values-screenshot3.png  
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On