How to insert ORACLE HINT into select statement....

Hi team,
Can you please suggest me how to add an Oracle hint to point the Program to BSAD~1.
Index BSAD1 has all three fields MANDT, BUKRS, AUGDT which are there in the where clause. But as per the execution plan index BSAD0 is being used which is the primary one.
Also the stats for this table are are current.
Thanks in Advance.
Puneet.

Hi punnet, look at this example:
  SELECT MAX( kkop~augbd )
  INTO it_gen_docs-augbd
  FROM ( fkkvkp AS vkp INNER JOIN dfkkop AS kkop
     ON vkpvkont = kkopvkont ) INNER JOIN dfkkko AS kkko
     ON kkopaugbl = kkkoopbel
  WHERE vkp~exvko = ti_cuentas-exvko
        AND kkop~bukrs = p_bukrs
        AND kkop~blart IN r_blart
        AND kkop~augst = '9'
        AND kkko~blart IN r_blartd
%_HINTS ORACLE 'INDEX("DFKKOP" "DFKKOP~Z07")'.
DFKKOP is the table name and DFKKOP~Z07 is the index.
I hope this helps you.

Similar Messages

  • How to insert variable value using select statement - Oracle function

    Hi,
    I have a function which inserts record on basis of some condition
    INSERT INTO Case
    Case_ID,
    Case_Status,
    Closure_Code,
    Closure_Date
    SELECT newCaseID,
    caseStatus,
    Closure_Code,
    Closure_Date,
    FROM Case
    WHERE Case_ID = caseID
    Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
    how can i use this.
    thanks

    Hi,
    I have a function which inserts record on basis of some condition
    INSERT INTO Case
    Case_ID,
    Case_Status,
    Closure_Code,
    Closure_Date
    SELECT newCaseID,
    caseStatus,
    Closure_Code,
    Closure_Date,
    FROM Case
    WHERE Case_ID = caseID
    Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
    how can i use this. Do not select Case_Status from inner select, so null will be inserted then after inserting it update the case status with m_caseStatus.
    Regards.

  • HINTS in Select Statement

    Hi,
    Can anybody explain me why HITS keyword is used with SELECT statement, whats the use of if, How to find the HINTS for a particular table.
    SELECT recn, recnroot, ippers
    INTO CORRESPONDING FIELDS OF TABLE <ITAB1>
    FROM CCIHT_IP
    FOR ALL ENTRIES IN <ITAB2>
    WHERE ippers = <ITAB2>-ippers
    AND valfr LE sy-datum
    AND valto GE sy-datum
    AND iptype = 'INJ'
    %_hints db2 '&max_blocking_factor 500&&max_in_blocking_factor 500&u2019.
    -Rajiv

    Hi,
    Complex database statements or large numbers of secondary indexes that can be very
    similar make it difficult for the database optimizer and the R/3 database interface to process
    most efficiently. In some database systems, you can expressly influence decisions made by
    database optimizer by what are known as hints.
    Ex- %_HINTS ORACLE '&SUBSTITUTE VALUES&'.
    Search with HINTS in SELECT STATEMENT you will get so many ans

  • How To Insert A object into Conext

    Hi Techies,
    I have 8 tables in my designer
    and I have two contexts at designer level
    And how to insert a object into a context that is not referencing any table.
    For Example I have an object like "rownum" (Which should must be added at Universe level only not at report level). Here this object is not referencing any table and I want this to be used in a query where the remaining objects are coming from the context..
    Thanks in Advance..

          Double-click the Objects and click the TABLES button and select the table you want to associate the object to for the context to work properly (see below).
    Regards,
    Ajay

  • How to insert a query into a NEW workbook ?

    Hi Friends,
    Could some one tell me how to insert a query into a new workbook? i am trying to run query in NW2004S BEx Query Designer, which always open the query on web when executed. i want to run the query in NW2004S BEx Query Designer and want it to open the result in Excell.
    If i am not wrong then to do the same, i need to embed the query into workbook. Correct me if i am wrong. If i am right then plzz tell me the steps to insert the query into workbook.
    Ur help will be rewarded in terms of points.
    Thanks,

    Hello,
    If you open the BEx Query Designer from the desktop, you cannot execute the query directly to the BEx Analyzer for an Excel view. You can only execute it directly to the Web. This is true for the SAP BW 3.x version as well as the SAP NetWeaver 2004s version.
    If you open the BEx Query Designer from within BEx Analyzer, once you select (or create) your query, you will have a green check mark icon that will then allow you to deploy the query directly to the BEx Analyzer for the Excel view.
    However, this would only make sense if you are creating or modifying the query. If not, you would simply open BEx Analyzer and use the Open Query option in this tool to see your query in an Excel format, as has been previously suggested by the other respondents to this posting.
    Regards,
    Katie Beavers
    SAP NetWeaver Product Management

  • How to call user fuction in select statement.

    hi,
    i am facing some problem.How to call user functions in select statement.please send me answer with example.
    Thanks
    Gopal

    Locations to Call User-Defined Functions
    • Select list of a SELECT command
    • Condition of the WHERE and HAVING clauses
    • CONNECT BY, START WITH, ORDER BY, and GROUP
    BY clauses
    • VALUES clause of the INSERT command
    • SET clause of the UPDATE command
    Restrictions on Calling Functions from SQL Expressions
    To be callable from SQL expressions, a user-defined
    function must:
    • Be a stored function
    • Accept only IN parameters
    • Accept only valid SQL data types, not PL/SQL
    specific types, as parameters
    • Return data types that are valid SQL data types,
    not PL/SQL specific types
    • Functions called from SQL expressions cannot
    contain DML statements.
    • Functions called from UPDATE/DELETE statements
    on a table T cannot contain DML on the same table
    T.
    • Functions called from an UPDATE or a DELETE
    statement on a table T cannot query the same table.
    • Functions called from SQL statements cannot
    contain statements that end the transactions.
    • Calls to subprograms that break the previous
    restriction are not allowed in the function.
    jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to put OR clause in SELECT statement

    Hi
    How to put OR clause in SELECT statement to return number_first/number_last to match records from another table's column.
    <pre>
    SELECT
    a.id ,
    flat_number ||' '|| a.number_first||' '||a.street_name||' '||a.suburb address1,
    apt_no ||' '|| street_no||' '||b.street_name||' '||b.suburb address2
    from
    a ,
    b
    where b.street_name = a.street_name
    AND b.SUBURB = a.SUBURB
    AND b.STATE = a.STATE
    </pre>
    Thsi will return this as exact match.
    ADDRESS 1
    12 TAMAN TENANG A ORCHARD 3142     
    10 RAMA YISHUN 2095
    ADDRESS2
    12 TAMAN TENANG A ORCHARD 3142     
    10 RAMA YISHUN 2095
    However this only matches number_first.
    How can I get the query work that it will match both number_first and number_last (table b)in address 1 to match street_no in address2 ( table b).My oracle version is 10GR/2.

    Hi, I have a hard time understanding your request, and below is what I thought you want:
    SELECT
        a.id ,
           flat_number ||' '|| (decode(b.street_no, a.number_first, a.number_first, a.number_last, a.number_last)||' '||a.street_name||' '||a.suburb  address1,
             apt_no ||' '|| street_no||' '||b.street_name||' '||b.suburb address2
          from
                 a ,
                 b
                where          b.street_name = a.street_name
                 AND            b.SUBURB      = a.SUBURB
                AND            b.STATE       = a.STATE
                AND  (B.street_no=a.number_first OR b.street_no=a.number_last);Not tested.
    Also, since your B.street_no will be either a.number_first OR a.number_last, you could replace
    (decode(b.street_no, a.number_first, a.number_first, a.number_last, a.number_last) with just b.street_no.
    Edited by: PhoenixBai on Aug 26, 2010 11:33 AM

  • How to insert a value into a field of binary type?

    I've been using Oracle for a while now but never dealt with BLOB
    or long raw type before. Does anyone here know how to insert a
    record into a field of either blob or long raw type?
    Any suggestions would be very appreicated.
    Thanks.

    pls used the loadfromfile procedure which is in the DBMS_LOB
    package to insert the data from external os file into blob data
    type column.
    Kunjan

  • How to insert line number into APPLIED_CUSTOMER_TRX_LINE_ID?

    Hi All,
    I am working on the table of receivable AR_RECEIVABLE_APPLICATIONS_ALL.
    I get some information about APPLIED_CUSTOMER_TRX_LINE_ID form TRM.
    APPLIED_CUSTOMER_TRX_LINE_ID     NUMBER     (15)     
    The line number of the debit item or credit memo to which a payment or credit memo is applied
    So, I want to use APPLIED_CUSTOMER_TRX_LINE_ID to join with transaction's line (RA_CUSTOMER_TRX_LINES_ALL).
    But after applied the credit memo, the APPLIED_CUSTOMER_TRX_LINE_ID is NULL.
    How to insert line number into APPLIED_CUSTOMER_TRX_LINE_ID?

    Hi Eric,
    The application is already at the AR Invoice (header) level. Oracle doesn't give you privilege to apply the invoice at invoice line or distribution level. You need to match the applied_customer_trx_id to customer_trx_id of ra_customer_trx_all to get the applied invoice/debit memo number. Hope my comments are helpful to you.
    KG

  • How to insert icons in the selection-screen

    how to insert icons in the selection-screen?

    Mohan,
    Report zex33.
    type-pools: icon.
    selection-screen begin of line.
    selection-screen comment 1(20) text_001.
    parameters: p_werks type marc-werks.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_002.
    parameters: p_whouse(10).
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_003.
    parameters: p_auart like vbak-auart.
    selection-screen end of line.
    initialization.
      write ICON_PLANT  as icon to text_001.
    concatenate text_001 text-001 into text_001 separated by space.
      write ICON_WAREHOUSE  as icon to text_002.
    concatenate text_002 text-002 into text_002 separated by space.
      write ICON_ORDER  as icon to text_003.
    concatenate text_003 text-003 into text_003 separated by space.
    Pls. reward for all useful answers........

  • Can anyone advise me how to insert a hyperlink into a project I am using Captivate 5?

    Can anyone advise me how to insert a hyperlink into a project - I am using Captivate 5

    You can use an interactive object such as a click box placed over the top of a text caption, or a button, to link to the URL.  However, these will not strictly-speaking appear identical to hyperlinks.
    If you really want to replicate the rollover appearance of a true HTML text hyperlink, then you might consider the Hyperlink widget from Infosemantics:
    http://www.infosemantics.com.au/adobe-captivate-widgets/hyperlink-interactive/help
    Free trial versions for download hers:
    http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets

  • How to load oracle data into SQL SERVER 2000?

    how to load oracle data into SQL SERVER 2000.
    IS THERE ANY UTILITY AVAILABLE?

    Not a concern for an Oracle forum.
    Als no need for SHOUTING.
    Conventional solutions are
    - dump the data to a csv file and load it in Mickeysoft SQL server
    - use Oracle Heterogeneous services
    - use Mickeysoft DTS
    Whatever you prefer.
    Sybrand Bakker
    Senior Oracle DBA

  • How to connect oracle database into VC?GIve step by step.

    Hi Experts,
    Please help
    How to connect oracle database into VC?
    I need step by step.
    what shall i do the first to connect via jdbc or  something else.
    whether we have to create dsn name or using jdbc connections?which one to use?
    Please give the basic steps.Its very urgent.
    Thanks and Regards,
    Nutan

    Hi ,
    all information are in the following document:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424">How to Configure a Business Intelligence JDBC System for Visual Composer</a>
    Rgds,
    Karim

  • How to insert a photo into a film strip theme

    I am making a imovie with a lot of pictures and few videos but I was wondering how to insert the pictures into the filmstrip theme. I have seen it done in other peoples movies before i just cant figure it out

    Hi Bob,
    With titles, all you need to do is drag them directly onto a video clip or still - the Theme will automatically take care of placing the video into the appropriate frames.
    Similarly with transitions. Drag the theme transition between 2 clips (video or stills) and the frames will be "populated" automatically. If you now click on the transition, you will see that each frame is numbered, both in the viewer and the timeline. Simply drag the numbers in the timeline to a different position to change the stills in the transition.
    Hope I've not misunderstood what you are trying to do!
    John

  • Hi, plz help me. i wanna store photos to sql database. so how to insert file field into insert record in dreamweaver cs3?

    I dont know how to insert file field into insert record in DW. i also want to know, insert dynamic table with image field. Plz help me anyone. Ty..

    ohh kk thank you bro. But How to store photos to server file. I wanna upload and display the photos in webpage. Can you send me the php code for this?

Maybe you are looking for

  • How do I print directly from my iPad to wireless Brother air printer ?

    We cannot print directly from ipad1.  We have a new Brother pie print compatible (supposedly) printer, given as a gift, model MFCJ825DW.  It prints nicely from my MacBook Pro through our home wifi network.  The iPad, however, will not connect to the

  • Download error -5000

    I purchased music but receive repeated download errors (-5000).  I've checked and updated all "permissions" but still cannot download the music for which I've already been charged!  Help please!

  • Double Charge for app purchase

    My order no.  MGZFDZN337  dated 04/19/13  05:40PM I have bought an app from app store through my iphone. Today, I received invoice and found it's double charge for this app. Why it's happen?  Kindly check and delete one charge for me. Thank you Regar

  • Coding for unexpected crashes.  Recovering data

    I am trying to find some best practices on how to handle unexpected application crashes. I am mainly looking for ideas on how to lose the least amount of data as possible. I like how programs like Microsoft Word and Open Office Writer can crash and t

  • Mac Pro SpeedTest MUCH Slower Than MacBook!?!?!?

    I just upgraded my cable modem to a DOCSIS 3.0 model. My Mac Pro consistently gets 4 Kb/sec whereas my MacBook, Mac Mini, and a PC all consistently get 15+ Kb/sec. I've tested the MacPro with the same physical ethernet connection as the MacBook and g