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

Home -> Community -> Usenet -> c.d.o.server -> Re: CURSOR_SHARING=SIMILAR

Re: CURSOR_SHARING=SIMILAR

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 03 Aug 2006 22:33:59 +0200
Message-ID: <obn4d2tn9s6o96olndbbu9ajc5um35tep8@4ax.com>


On 3 Aug 2006 13:05:34 -0700, "Sethu" <sethu77_at_hotmail.com> wrote:

>Hi,
>
>I am using Oracle 9i (9.2.0.6) on HPUX. I have the CURSOR_SHARING
>parameter set to SIMILAR and on testing I believe I may have some
>issues.
>
>SQL> alter session set cursor_sharing = 'EXACT';
>
>Session altered.
>
>SQL> select 'AAA' from dual;
>
>'AA
>---
>AAA
>
>SQL> alter session set cursor_sharing = 'SIMILAR';
>
>Session altered.
>
>SQL> select 'AAA' from dual; --- <== found from cache
>
>'AA
>---
>AAA
>
>SQL> select 'BBB' from dual; -- <== brand new one, notice the
>size of the returned value
>
>'BBB'
>--------------------------------
>BBB
>
>I read an article in asktom site about this which explains the reason
>as Oracle binds the literal string to a variable length constant. My
>question is can it create a problem, if my application looking for Y/N
>values coming back and the sql returned 'Y ' ?

I don't think Oracle implicitly trims hardcoded literals. So 'Y' and 'Y ' would result in multiple children for this statement and potentially different execution plans.

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Aug 03 2006 - 15:33:59 CDT

Original text of this message

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