Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Bind values missing from SQL trace

RE: Bind values missing from SQL trace

From: Dunbar, Norman <norman.dunbar_at_environment-agency.gov.uk>
Date: Thu, 16 Aug 2007 08:02:55 +0100
Message-ID: <919FC80F27E0C6428106496EDF92A7525F6572@EXCCLUS05.PRODDS.NTNL>

Morning Rich,

>> My only evidence is that trying to duplicate the statement
>> using nulls or blanks for those variables returns no rows,
>> where the app clearly does.

This is a giveaway :

 bind 0: dty=1 mxl=128(50) mal=00 scl=00 pre=00 oacflg=03 oacfl2=800010 size=160 offset=0

   bfp=11058efc0 bln=128 avl=50 flg=05
   value=""

The MXL=128(50) says max length is 128 current length is 50. Also, the AVL=50 confirms that the actual length of the bind data is indeed 50.

So, you are passing a 50 character value over. If, as others have suggested, you were passing NULL then AVL would be zero. The number in parenthesis after the MXL is 'random' in that instance - cannot be trusted.

Jonathan has an example showing this very thing :

http://jonathanlewis.wordpress.com/2007/07/29/nls/

And I quote :

"on a hunch I generated two traces, one when using nvarchar2 as datatype for the bind variable and one using varchar2 as datatype. And indeed, the one where I used the nvarchar2 datatype was showing the full table scan and lacked the values for the bind variables in the trace files, while the one with the varchar2 datatype was using the index and had the bind values filled in."

So, it could be that the use of 'N' data types precludes their use in the trace file - maybe because they wouldn't show up correctly in the trace file perhaps if they were in some 'exotic' character set?

Cheers,
Norm.

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.

We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Aug 16 2007 - 02:02:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US