Please reply:how to avoid extra trailing spaces while using cursor sharing

i am using cursor sharing with FORCE or SIMILAR.
what is the solution to avoid extra trailing spaces without any java code change.
do we have any option in oracle to avoid extra trailing spaces during the query processing ?
I am using Oracle 10g
CURSOR SHARING is a feature in which multiple sql statements
which are same will have a shared cursor (in the library cache) for an oracle session,
i.e, the first three steps of the sql processing (hard parse, soft parse, optimization)
will be done only the first time that kind of statement is executed.
There are two ways in which similar SQL statements with different condition values can be made to "SHARE" cursor during execution:
1. Writing SQLs with Bind Variables: SQLs having no hard coded literals in them
For e.g., the query below
SELECT node.emp_name AS configid
FROM emp node
WHERE emp_no = :1
AND dept_no =
DECODE (SUBSTR (:2, 1, 3),
:3, :4,
(SELECT MAX (dept_no)
FROM emp
WHERE emp_no = :5 AND dept_no <= :6)
AND node.dept_type = :7
ORDER BY node.emp_name
Here all the variables are dynamically bound during the execution. The ":X" represents BIND Variable and the actual values are bound to the SQL only at the 4th step of the execution of the SQL.
In applications: The queries written with "?" as bind variables will be converted into ":X" and are sqls with Bind Variables.
2. The CURSOR_SHARING parameter: Only Useful for SQL statements containing literals:
For eg., the query below:
SELECT node.emp_name AS configid
FROM emp node
WHERE emp_no = 'H200'
AND dept_no =
DECODE (SUBSTR (:1, 1, 3),
'PLN', :2,
(SELECT MAX (dept_no)
FROM emp
WHERE emp_no = :3 AND dept_no <= :4)
AND node.dept_type = :5
ORDER BY node.emp_name
In the query above, there are two hard coded literals H200 , PLN. In this case when the same SQL executed with different values like (H2003 , PLN), oracle will create a new cursor for this statement and all the first three steps ( hard & soft parse and optimization plan) needs to be done again.
This can be avoided by changing the CURSOR_SHARING parameter which can be set to any of three values:
1. EXACT: Causes the mechanism not be used, i.e. no cursor sharing for statements with different literals. This is the default value.
2. FORCE: Causes unconditional sharing of SQL statements that only differ in literals.
3. SIMILAR: Causes cursor sharing to take place when this is known not to have any impact on optimization.
So, FORCE and SIMILAR values of the parameter will be helping in cursor sharing and improve the performance of the SQLs having literals.
But here the problem arises if we use the FORCE and SIMILAR other than EXACT.
alter session set cursor_sharing ='EXACT'
select 1 from dual;
'1'
1
alter session set curson_sharing='FORCE'
select 2 from dual;
'2'
2
alter session set curson_sharing='SIMILAR'
select 3 from dual;
'3'
3
So, this will give extra trailing spaces in when we retrieve from java method and any
further java processing based on the hardcoded literal values will fail. this needs lot of
effort in remodifying the existing millions of lines of code.
My question is i have to use cursor sharing with FORCE or SIMILAR and can't we do the trimming
from the oracle query processing level ?
please help me on this ?
Message was edited by:
Leeladhar
Message was edited by:
Leeladhar

Please reply to this thread
How to avoid extr trailing spaces using Cursor sharing opton FORCE, SIMILAR

Similar Messages

  • How to avoid Print pop-up while using a Adobe form.

    Hi Experts,
    I am calling a adobe form from a BAPI.I am using the following function modules FP_FUNCTION_MODULE_NAME and CALL FUNCTION fun_name. But when I try to execute the BAPI a print preview pop-up appears.Please let me know the steps to avoid the print preview pop-up while execution of the BAPI.
    Thanks in Advance.
    Warm Regards,
    Arun.

    Hello
    I don´t understand the connection between BAPI and the printing program. I guess - at least that is what I have done - is to generate the form when creating and invoice or something, then I could understand.
    When you ask for GETPDF = 'X' then you always get the PDF data back and not the popup.
    Or if you would like to display the print preview without a print settings popup. Or variants...
    FUNCTION ZPDF_SET_OUTPUT_MODE.
    *"*"Lokální rozhraní:
    *"  CHANGING
    *"     VALUE(FP_OUTPUTPARAMS) TYPE  SFPOUTPUTPARAMS
    fp_outputparams-dest     = 'ZPDF'.
    fp_outputparams-nodialog = 'X'.
    fp_outputparams-preview  = 'X'.
    ENDFUNCTION.
    regards Otto

  • How to avoid:Query returns extra trailing spaces in oracle 10g

    I want to use cursor sharing FORCE, SIMILAR for performance tuning. but i am having some problems like query process will give extra trailing spaces this will throw errors from the java application while reading literals.
    do we have any option in oracle 10g to avoid extra trailing spaces during query processing ?
    alter session set cursor_sharing ='EXACT'
    select 1 from dual;
    '1'
    1
    alter session set curson_sharing='FORCE'
    select 2 from dual;
    '2'
    2
    alter session set curson_sharing='SIMILAR'
    select 3 from dual;
    '3'
    3

    You are right, But we already wrote millions of queries during that time we used cursor sharing is EXACT. so i don't want to take risk in modifying all the existing queries by adding TRIM.
    do we have any option in oracle to trim after/ during processing the query.
    Now we are facing performance issues and suggested us to use SIMILAR as cursor_sharing. but all the selected rows are giving extra tralining spaces.
    I think i am clear now.

  • How to identify the trailing spaces in a column

    Hi,
    How to identify the trailing spaces in a column.
    for ex: empno char(5) and i enter 333 then there will be 2 spaces remaining. How to identify that two spaces

    One method...
    ME_XE?create table test1 (some_char char(5));
    Table created.
    Elapsed: 00:00:00.11
    ME_XE?
    ME_XE?insert into test1 values ('HI');
    1 row created.
    Elapsed: 00:00:00.07
    ME_XE?insert into test1 values ('HI HO');
    1 row created.
    Elapsed: 00:00:00.07
    ME_XE?select * from test1 where trim(some_char) <> some_char;
    SOME_CHAR
    HI
    1 row selected.
    Elapsed: 00:00:00.14
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to improve the load performance while using Datasources for the Invoice

    HI All,
    How to improve the  load performance while using Datasources for the Invoice . Actually my invoice load (Appx. 0.4 M records) is taking very long time nearly ~16 to 18 hrs  to update data from R/3 to 0ASA_DS01.
    If I load through flat file it will load with in ~20 Min for the same amount of data.
    Please suggest how to improve load performance.
    PS: I have done the Inpo package settings as per the OSS note.
    Regads
    Srininivasarao.Namburi.

    Hi Srinivas,
    Please refer to my blog posting [/people/divyesh.jain/blog/2010/07/20/package-size-in-spend-performance-management-extraction|/people/divyesh.jain/blog/2010/07/20/package-size-in-spend-performance-management-extraction] which gives the details about the package size setting for extractors. I am sure that will be helpful in your case.
    Thanks,
    Divyesh
    Edited by: Divyesh Jain on Jul 20, 2010 8:47 PM

  • HT202213 I have 3 users on one computer with 3 unique user accounts.  Each have unique ITunes accounts.  How do we share our music libraries using home sharing?

    I have 3 users on one computer with 3 unique user accounts.  Each of us have separate and unique ITunes accounts.  How do we share our music libraries using Home Sharing?  Everything that I can find talks about sharing between networked computers, but this is all on the same computer.  I just want to share between ITunes accounts.  Thanks!

    Hi b noir, I also have two users on one pc with two different iTunes libraries.  But I also want to put them onto an external hard drive so that I can free up some memory on the pc.  So I figure I need to consolidate the two users iTunes libraries first before moving to hard drive?  But not quite sure how to do that on the iTunes 11?  Thanking you in advance!!

  • Hi, can anybody tell me how I connect my iPad to  AppleTV using  "home  sharing" ? Thanks

    Hi, can anybody tell me how I connect my iPad to AppleTV using home sharing? I can,t find hoe sharing on my iPad. Thanks

    Apple TV
    http://support.apple.com/kb/HT4437
    http://support.apple.com/kb/HT5209
    http://support.apple.com/kb/HT4352

  • How do I sort or reorganize while using the new Numbers 3.0

    How do I sort or reorganize while using the new Numbers 3.0; I can't seem to find the sort icon.
    Thanks
    ActiveSolutions

    Yes, I understand the convenience of the old Reorganize panel. I thought it was great. The problem is (I'm guessing) that it is really hard to do something like that in Numbers iOS and Numbers for iCloud. So they gave us features that are more likely to work across all platforms.
    If you need to sort just selected rows you could put the =A&C&B formula (or whatever order you need) in just the rows you need to sort. Leave the other cells in column D blank.
    Or, if you're doing a LOT of partial sorting like that maybe you should have the data in separate tables anyway.
    Not saying it's great... just saying there are workarounds... until (if) something like the Reorganize panel comes back by popular acclaim. 
    SG

  • How to avoid extra page

    HI all,
    I am getting my ouptut in smartforms . But the problem is i am getting an extra page with logo at the end. How to avoid that?
    Here i am using only 2 windows. LOGO window and main window.
    Thanks & Regards,
    Vineel

    Check your main window and see whether there are any blank lines inside your main window... if that is not the case check whether you are using any command and calling the new-page in smartform... if yes.. goto command and un-check the tick box goto next page.
    Close the thread once your question is answered.
    Regards,
    SaiRam

  • How to add extra blank space in xml

    I open the xml file in notepad I get this
    <XXON_EXT_BANK_ACCOUNT_NAME>創名聯合會計師事務所                                        </XXON_EXT_BANK_ACCOUNT_NAME>
    But when I open the xml file in html format the blank space is gone.
    How can I add extra blank space in xml?

    Hi
    Why do you need the extra space for?
    This difference in display that you see between your browser and notepad/notepad++
    will not affect your generated report.
    Bogdan 

  • How to trim / delete trailing space

    My file contention conversion for recordset struture 'DT_INTERFACE_in_s' in recevier communication channel is below:
    DT_INTERFACE_in_s.fieldNames     zdata1, zdata2,FILE_NAME
    DT_INTERFACE_in_s.fieldFixedLengths     4,1000,0
    DT_INTERFACE_in_s.fixedLengthTooShortHandling     Cut
    DT_INTERFACE_in_s.ignoreRecordsetName     True
    DT_INTERFACE_in_s.fieldContentFormatting     Trim
    DT_INTERFACE_in_s.lastFieldsOptional     Yes
    DT_INTERFACE_in_s.fieldSeparator     
    DT_FMS_INTERFACE_in_s.endSeparator     'nl'
    The content of zdata1 and zdata2 are sent to receiver. But there are 1000 characters for zdata2. I want to delete the trailing space of zdata2.  Pls. help

    Hi,
    This is because you are using fieldFixedLengths. So PI adds trailing spaces to match your configuration for the field to be 1000-characters long. Simply switch to fieldSeparator to have the fieldContentFormatting = Trim working fine.
    I am also not sure if this is the configuration for sender or receiver channel. You are writing about the receiver, but some parameters you use are specific for sender only. Please refer here if required:
    [Converting Text Format in the Sender File/FTP Adapter to XML|http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6713ec3f914ddee10000000a1553f7/content.htm]
    [Converting XML in the Receiver File/FTP Adapter to Text Format|http://help.sap.com/saphelp_nwpi71/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm]
    Hope this helps,
    Greg

  • Trailing space when using SELECTION-SCREEN COMMENT

    Hi All,
    I need to display a continuous text (length :130) in selection screen. I am trying with SELECTION-SCREEN COMMENT option and i m aware that we can display max of 79 characters. So i split the text into length: 70 & 60 and coded as below
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(70) text-001.
    SELECTION-SCREEN POSITION 73.
    SELECTION-SCREEN COMMENT 73(60) text-002.
    SELECTION-SCREEN END OF LINE.
    Problem is: After displaying first text (text-001), there is a gap of 10-15 characters, then second text starts (text-002). I mean, there is a trailing space.
    If i give all text-001 in CAPS, then there is no trailing space. But i dont need to display the text in CAPS.
    Do i need to proceed in any other way?, please provide your inputs
    Vinoth

    Your SAPgui to use a proportional font for texts and descriptions (where "i" is much shorter than "W") when it use a non-proportional for input fields. But it use this non-proportional font for input fields even if input is not allowed.
    Try this sample to solve your problem. (But your text will be in a box)
    REPORT zfontst.
    CONSTANTS ctxt TYPE c LENGTH 80 VALUE 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'.
    PARAMETERS: p1 TYPE c LENGTH 56.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (2) p2a.
    SELECTION-SCREEN POSITION POS_LOW.
    SELECTION-SCREEN COMMENT (56) p2.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: p3 TYPE c LENGTH 56 MODIF ID dsp.
    AT SELECTION-SCREEN OUTPUT.
      p1 = ctxt.
      p2 = ctxt.
      p2a = 'P2'.
      p3 = ctxt.
      LOOP AT SCREEN.
        CASE screen-group1.
          WHEN 'DSP'.
            screen-input = '0'.
        ENDCASE.
        MODIFY SCREEN.
      ENDLOOP.
    Regards,
    Raymond

  • How to avoid lo-gin prompt while check in the document and saving doc while opening the document?

    Hello
    I might be missing something to configure or verify but many times I have faced below situation :
    When I click on document in document library either its just opens or first save to disc and open.
    When I check in a document , its asking for credentials but sometimes doesn't
    Can anyone please describe the reason behind above behaviors ? how to avoid saving doc while opening and lo-gin prompt while check in the document?
    Thanks and Regards,
    Dipti Chhatrapati

    It the sharepoint site accessed through firewall
    http://support.microsoft.com/kb/2756625
    You can try adding below registry
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters\AuthForwardServerListAdd the site to Trusted Sites Zone instead of Intranet Go to Control Panel >> User Accounts >> Manage Your Credentials and remove any credentials storedMake sure your office and IE Is same build (64 or 32)http://www.techrepublic.com/blog/smb-technologist/prevent-unwanted-credentials-prompts-with-sharepoint-document-libraries/ checked that 'basic authentication' is unchecked under Central Administration -> Application Management -> Authentication
    ProviderOr tryhttp://social.technet.microsoft.com/Forums/office/en-US/45feb132-c304-4521-8b79-42236a829aab/login-prompt-appearing-when-opening-office-documents?forum=sharepointadminlegacy
    If this helped you resolve your issue, please mark it Answered

  • How to avoid Room Part folder while adding Room Part?

    Dear friends,
    When i add new Room Parts in the Room Maintenance, it add the room part with the folder. 
    Is there anyway where i can avoid the folder to be displayed and only the part link to displayed.
    please reply
    kantha

    I'm also looking for a solution to this.  I've tried some fancy stuff that I though should work - configuring the Room Part Workset as a 'Leaf Folder' and then setting the page underneath as 'Invisible in Navigation' and as the 'Default Entry for Folder'.  This works properly in the normal DTN, but it seems like the rooms use a special DTN that incorporates some additional logic, and does not understand the 'Leaf Folder'.  It displays the workset as a page, but then when you click on it, a blank page shows up in the content area and the DTN does not select the just selected node.  If I had to guess, SAP forked the code and created a similar looking/functioning DTN specifically for Collaboration Rooms, but did not include all bug fixes or features.
    This page discusses the 'Leaf Folder' feature...
    http://help.sap.com/saphelp_nw70/helpdata/en/9d/36458642e748d7a4bfbf44f00cd7a7/frameset.htm
    Can anyone from SAP comment on this (seeming) limitation?  Thanks.

  • How to avoid line break ( br ) while exporting Interactive report in Excel

    Hi,
    I have a Interative report and I am using Apex download format as CSV.
    I have defined some of the column heading in multiple line using break < br >
    when I export this into the excel sheet..the column heading contains break also..
    - Any idea how to avoid line break while exporting in excel.
    - also how to put the columns heading in BOLD when exported in excel.
    Thanks,
    Deepak

    Hi Jari,
    I tried this but still getting the
    <br>Interactive Report
    Column Attributes Heading - Employee<br>Detail AddressWhen I download the Report in CSV Format
    I am getting the heading with <br>.
    I am looking for heading as - Employee Detail Address // with no <br> tagThanks,
    Deepak

Maybe you are looking for