How to fetch the select statements

Hi all ,
I am able to display all the lines in the program if i give the program name as my input .
I need to fetch only the select statements from that program . so please any one help me out to solve this problem.
thanks
shwetha

before write statement just put one if condition.
if statement cs 'select'.
  write: / statement.
endif.
<b><removed_by_moderator></b>
<b><removed_by_moderator></b>
feel free to ask any quieries my mail id
<b><removed_by_moderator></b>
<b><removed_by_moderator></b>

Similar Messages

  • How to test the select statement.

    Hi All,
    How to test the select statement.
    Is there any Oracle sqlplus  or toad kind of tool to  test the query.
    thanks
    siva

    Use SQL Trace (ST05) and choose 'Explain one SQL Request'. Enter your SQL command as it should be executed in the underlying database. e.g. if the db is Oracle, the statement should be entered as:
    SELECT matnr,werks,lvorm,dispo
    FROM marc
    WHERE mandt = :a AND
                 matnr = :b AND
                 werks = :c
    In the above :a, :b and :c are place holders for the actual comparison values. You dont have to enter those values. When you choose 'Explain' button, you will find the 'Execution Plan'. The important parameter which denotes the efficiency of the SQL statement is the 'Cost'. The cost should be as low as possible. The table access should be through INDEX UNIQUE SCAN. If you get a FULL TABLE SCAN and higher cost, you need to fine-tune your statement by modifying the where clause.
    If you dont know Oracle SQL statements, execute the program in trace mode and go to the trace and you will find the underlying SQL statements issued to the database.
    Regards
    Suresh Radhakrishnan

  • How to know the select statement perfomence

    how to know the select statement perfomence. suppose i have 10 select statements in my program. how will i know which select statement not performance wise poor.

    Go to ST04/
    Click on Detail Analysis menu button.
    Click on the SQL Request button.
    In the pup up give <table name> and execute.
    Then you will get a list of all the programs that have a select on that table.
    Or ST05 transaction t start the trace and run your program .Deactivate the trace in st05 .
    and display the trace.
    Regards,
    Ravi

  • How to find the select statement has written all selected values into text

    Hi,
    I am using form6i. i am selecting a set of values from database tables based upon some user parameters and writing into the text file using Text_io.put_line . In this case how we can make sure that the text fille contains all the data what we are selected from selected statement. somebody told that there might be chances of aborting of data while writing into the text file. is there any way to fild out the selected statements has written all the selected fields and corresponding output into the .txt file.
    Please suggest me.

    somebody told that there might be chances of aborting of data while writing into the text fileWhat kind of "chance" does that somebody refer to?
    If you want to verify if the number of records (lines) in the file matches the number of records from the cursor, you could re-open the written file in read-mode and count the number of lines by reading one by one, then compare the number of lines with the number of records from the cursor.

  • How to get the select statement from the DISPLAY_ERROR; window

    Hi
    Do you know a way to get the select statement that is displayed in the
    display_error; window ( select hola from u where a = :d),
    this for saving to a text file.
    Thanks in Advance.

    You must copy-and-paste it. You can't access that error from within Forms.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • How to use the select statement in for loop

    Hi All,
    my question is can we use select statement in for loop like as follows .
    for key in select key from one_table.
    when i am using this am getting an error like Found select invalid i identifier
    how to make use of select statement in for loop
    please suggest me .
    Thanks
    Sree

    SQL>set serveroutput on;
    SQL> DECLARE
         BEGIN
         FOR Cur_Rec IN (SELECT dname FROM dept) LOOP
          DBMS_OUTPUT.PUT_LINE(Cur_Rec.dname);
         END LOOP;
         END;
    SQL>
    ACCOUNTING
    RESEARCH
    SALES
    OPERATIONSAs per your requirement always filter the Query beforehand
    Like
    FOR Cur_Rec IN (SELECT key FROM <table> WHERE key=1) LOOP
    END LOOP;Edited by: Lokanath Giri on १ दिसंबर, २०११ ३:५६ अपराह्न

  • How can use the select statement  to retriev the data from  a where conditi

    Hi,
    SELECT KUNNR
               NAME1
               STRAS
               ORT01
               PSTLZ
               LAND1
         FROM  KNA1
         INTO TABLE IT_KNA1
         FOR ALL ENTRIES IN IT_LIKP
         WHERE KUNNR = IT_LIKP-KUNNR AND
               KUNNR = IT_LIKP-KUNAG.
    Here I am getting records only when WHERE KUNNR = IT_LIKP-KUNNR AND
                                            KUNNR = IT_LIKP-KUNAG.
    But I need the records for both when KUNNR = IT_LIKP-KUNNR
                                 And     KUNNR = IT_LIKP-KUNAG.
    Can you suggest me the best logic.
    Thanks.
    Kumar .

    Hi Suresh,
    Use the following code.
    Loop at it_likp.
    if it_likp-kunnr <> ' '.
    select name1 stras ort01 pstlz land1 into corresponing field of table it_kna1
             from kna1
             where kunnr = IT_LIKP-KUNNR.
    elseif it_likp-kunag <> ' '.
    select name1 stras ort01 pstlz land1 into corresponing field of table it_kna1
             from kna1
             where kunnr = IT_LIKP-KUNAG.
    elseif it_likp-kunnr <> ' ' and it_likp-kunag <> ' '.
    select name1 stras ort01 pstlz land1 into corresponing field of table it_kna1
             from kna1
             where kunnr = IT_LIKP-KUNNR
             AND   KUNAR = IT_LIKP-KUNAG.
    endif.
    endloop.
    hOPE THIS WILL WORK FINE.
    Rewards pts if it is usefull.
    Regards
    Srimanta

  • How to speed a select statement with the NOT EXISTS where condition ?

    Hi all,
    I created a view : create or replace view view_name as select * from table_1,table_2 where join_condition and some conditions.
    Now I have added in the view "where" clause two NOT EXISTS conditions based on one another different table respectively.
    Before I added these two conditions the response time was fast ; but after I added these two conditions then the response time deteriorated.
    So how to optimize the select statement ? Hints and so on ...
    Thank you very much indeed
    Message was edited by:
    andrianiaina

    Just run the script :
    SQL> explain plan for select * from dual;
    Explained.
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    | Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT     |             |       |       |       |
    |   1 |  TABLE ACCESS FULL   | DUAL        |       |       |       |
    Note: rule based optimization
    9 rows selected.
    SQL>Nicolas.

  • Restricting records in the select statement

    Hi,
    I have one requirement where in i need to restrict my select statement to get only 250 records in the output table.
    Here are the select statements i am using....
        SELECT a~ebeln
                     a~lifnr
                     a~ekgrp
                     b~werks
                     b~matnr
               FROM ekko AS a INNER JOIN ekpo AS b
               ON aebeln = bebeln
               INTO TABLE i_ekko
               WHERE a~ebeln IN r_ebeln AND
                            a~lifnr IN r_lifnr AND
                            a~ekgrp IN r_ekgrp AND
                            b~werks IN r_ewerk AND
                            b~matnr IN r_matnr AND
                            a~bstyp = 'F'.
                IF NOT i_ekko[] IS INITIAL.
    Select Vendor name
               SELECT lifnr
                            name1
                      FROM lfa1
                      INTO TABLE i_lfa1
                      FOR ALL ENTRIES IN i_ekko
                      WHERE lifnr = i_ekko-lifnr.      
    Here if i restrict the first select statement to get only 250 records then i am not getting the desired record in the second select statement.
    Could anyone let me know how to write the select statement.
    Regards,
    Ramesh

    restric the first select using up to 250.
    sort the i_ekko by vendor name.
    ex: sort i_ekko by lifnr.
    use second select statement here.

  • How to edit the records value fetched by select statement query in sqldever

    How to edit the records value fetched by select statement query in sqldever 2.1.1.
    EX-
    SELECT * FROM emp WHERE ename like 'Jaga%'
    Edited by: user9372056 on Aug 31, 2010 2:16 AM

    Hi,
    Although some forum members may be using that tool, there is still a dedicated forum for SQL Developer.
    SQL Developer
    Maybe your chances are better there.
    Regards
    Peter

  • How can I call a Page Process from the Select statement for Report Page

    I'm able to call a javascript using the below:
    img src="#IMAGE_PREFIX#add2.gif" border="0" alt="Icon 4" onClick="javascript:add_connect1('||CPORT.ID||')"
    But Now,
    I'd like to accomplish (2) New things:
    1. instead of using,....... onClick="javascript:add_connect1,
    I'd like to call a Page Process, onClick=
    2. I'd like to be able to call two different processes onClick.
    a. onClick="javascript:passBack('||ID||')"
    b. onClick= <Please see my question #1 above>
    Can someone please help me with the syntax for this,
    If indeed it can even be done?
    Thanks- Gary

    Greg.
    It seems that my situation is the one you describe in you second paragraph, where you mention:
    you could then add the ID column value as a parameter to the javascript functionBut,
    I do not know how to reference the variable in my javascript nor how to use it in my on-demand process.
    If you can hellp me past this last little bump, then I think I will be able to use these skills in Sooo many different areas of my design.
    Here's what I've got so far:
    A. In the select statement I identify the javascript as:
    onClick="javascript:connect_port('<font color=blue>''||ID||''</font>')";
    B. In my javascript I have this:
    <script language="JavaScript" type="text/javascript">
    function connect_port(ID)
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=CONNECT_PORT',0);
    gReturn = get.get();
    get = null;
    </script>
    C. In my on demand function I have this:
    BEGIN
    INSERT INTO CCONNECTIONS_B
    BLDG_ID,CLST_ID,PORT_ID,STRAND_ID
    ) VALUES
    :P2004_BLDG_ID,:P2004_CLST_ID,:P2004_PORT_ID,:P2004_STRAND_ID1
    END;
    You can see that I dont know how to use the value for 'ID' in either the javascript or the On-Process function.
    If you can help me out with this one, Then I can imitate it for the rest.
    -Gary
    Edited by: garyNboston on Apr 3, 2009 6:44 AM
    Edited by: garyNboston on Apr 3, 2009 6:44 AM
    Edited by: garyNboston on Apr 3, 2009 6:45 AM
    Edited by: garyNboston on Apr 3, 2009 6:47 AM

  • Need to fetch only the select statement

    Hi ,
    I am able to fetch all the select statements from my program if program name as my input.
    I want only the select statement where we fetch the field entries like
    select single from mara
    select * from mara
    select count(*)
    select matnr from mara
    like this i want to fetch i dont want to display the select-options or start-of-selection .

    Hello Shwetha
    If the function module <b>RS_PROGRAM_TABLES</b> (function group <b>SEA1</b>) is available on your system you can run this fm with the following parameters:
    - OBJECT_TYPE = 'TRAN'   " transaction
    - OBJECT_NAME = 'VA03'  " example
    - OBJECT_TYPE = 'PROG'   " report
    - OBJECT_NAME = 'SAPMV45A'  " example: report executed by VA03
    The fm returns you a list of tables that are accessed.
    Regards,
      Uwe

  • How to find what  are the select  statements fired on a particular schema

    Hi Guys,
    I have a development box schema whose username and the password is shared across many users who are doing the developement.
    I wnat to know what are the select statement fired on it during a particular time interval.
    Thanks,
    Prafulla

    with dba user
    BEGIN
    DBMS_FGA.ADD_POLICY(object_schema => 'schemaname',
    object_name => 'CALLS',
    policy_name => 'CALLS_AUDIT',
    statement_types => 'SELECT'
    …enable => TRUE);
    END;
    then all select are viewed on table dba_fga_audit_trail
    Edited by: Adigozalov Gurban on Dec 3, 2010 11:05 AM

  • How to fetch the correct netprice based on contract item conditions

    Hi,
    When you display a contract using ME33K and you click on a item and view its conditions(shift+F6), there might be 2 validity periods for a given item.
    and each period will have different netprice in it.
    Let me describe the same.
    Suppose the PO creation date is 04.07.2007
    The conditions for an item in a contract for the PO are as follows;
    1. Validity from 04.07.2007 validity to 04.07.2007 Netprice = 100.00
    2. Validity from 05.07.2007 validity to 31.12.9999 Netprice = 200.00
    We need to always fetch the net price from the validity period which always matches with the PO creation date. here the value 100.00 should be the correct netpr as the PO creation date matches with the first validity period.
    But the program is fetching the netprice 200.000 which belongs to the second validity period. That is because the select statement which fetches the data for contracts collects on the basis of EKKO-kdate and ekko-kdtab.The fields kdate and kdtab retrieves the validity period of the contract which is from 04.07.2007 to 31.072007. This data is then used to retrieve the netpr data from EKPO and it fetched 200.00 as it retrieves the net price of current data in contract validity and not with respect to PO creation date.
    This data is then used to fetch the get the netpr data from EKPO.
    what we need is the netprice for that validity period of item(Conditions) that matches with the PO creation date..
    Now I have the internal table which is having data retrieved from Ekko and EKPO table.
    Now how do I retrive the correct price by using the condition tables KONV and KONP.
    Can you pls give the code snippet..
    Thanks in advance.

    Hi,
    Please get the valid condition ( based on date ) from A016 (MK & LPA). With the appropriate KNUMH read the Condition header. You can access the different condition items viz., PB00, RA00 etc., for the values from table KONP. Further if you have Value scales / Quantity scales, you can read the data from KONM, KONW.
    An additional tips: in KONP, if you have a condition like RA00 - Rebate, the value will be multiplied by 10 and saven in database to accomodate the discount to the third decimal.
    I could not completely understand your requirements like nature of development ( Is it a Report / SAP Script ??) you are working etc., so that I could help you precisely.
    Hope this helps,
    Best Regards, Murugesh AS
    Message was edited by:
            Murugesh Arcot

  • In BI how to filter the selection options based on inputs on top field

    Hi Friends,
    In BI, How to filter the selection options based on inputs on top field.
    The system should automatically filter the lower level drop downs based on the selection of a higher level.
    For e.g. :
    If a user selects a Country then the States drop down should only display the State's belongs to the Country. Similarly when a State is selected, the District drop down should display only those District's belongs to the State.
    Thanks in Advance.
    Regards
    Jayaram M

    Hi Anil,
    Thanks for reply but I couldn't use Compounding Characteristic here. Need some other solution.
    Regards
    Jayaram M

Maybe you are looking for