Size of SQL query before execution and after execution

hi all
I need help on how can i find out the size of SQL query before execution and after execution in java
The query can be any query select / insert / update
Can anyone help me if any system tables help to find out the required size i mentioned
Urgent help is required
Thanking in advance

I need the size in terms of bytes
like the rquirement is stated as below
select ................: 10 B , return 250 B
so i need size before and after execution in terms of bytes

Similar Messages

  • Can we capture SQL Queries before execution?

    Hi Everyone,
    I would like to know that is there any way to capture SQL queries before execution?
    please advise.
    thanks
    kv

    Hi!
    You could capture the querys and use them as a payload for the "Database Engine Tuning Advisor".
    Maybe it gives you some indexes which raise the performance.
    But:
    I only would add indexes to user tables.
    Cheers,
    Roland
    PS.:
    Indexes which are created directly through SQL could be lost after a B1 Upgrade. So saving the creation-statements in a warm and secure place is recommended
    PPS.:
    ...and maybe such indexes are not supported by SAP...
    Edited by: Roland Toschek on Dec 1, 2008 6:23 PM

  • Before image and after image is not updating correctly with 2LIS_04_P_ARBPL

    Hello BW gurus
    I am facing problem with the posting date extraction from the extractor 2lis_04_p_arbpl. I am getting incorrect before image and after image. Please let me know how to solve this problem.
    Thanks and regards
    kiran.

    Hi,
    It is difficult to check this in the Source System and there is no direct method. I can give you a workaround which we did analysed for some of delta datasources.
    Steps to be followed sequentiall once the step is successful:
    1. Create a Production order or something.. Note down the number.
    2. Check the datasource whether you get the same Production Order as delta
    3. Now do whatever confirmation etc . for the same Production Order
    4. Check the datasource (RSA3) and see wat it extracts.. might be multiple records..
          In that case just see the sequence of records.. and the changes each record has brought in.. hope this way we can simulate the delta datasource realtime..
    And if you find the sequence or somthin is correct and in BW is not updating properly then it is our fault to dig and find out further.. If the issues is at the RSA3 itself, then u can raise an OSS Message as a Bug.
    Hope it helps.
    Regards,
    Chathia.

  • Order printout before realse and after relase

    hi
    all
    order printout before realse and after relase
    is this possibile
    it gives message teco not done
    my client wants in preparation and after relerase
    though iknow no logic is there but they stick to this
    thanks
    manoj

    hi
    i think you can print the order after the releasing of order or at the time of put in process.
    kindly refer the following [link|http://help.sap.com/saphelp_erp60_sp/helpdata/en/5b/ae36044b8611d182ba0000e829fbfe/content.htm]
    regards
    thyagarajan

  • Before image and after image concept of ODS

    Hi Gurus,
    Could anybody help me in understanding the concept of " Before image and after image in ODS"
    Kindly forward me if any good docs are available on my email ID: [email protected]
    With regards,
    wrushali

    check this link for after image.
    Re: regarding ODS
    and before image is snapshot of the data before a change took place
    after image is snapshot of the data after change.
    these are used for delta update.
    Hope it helps.
    Regards

  • LO Cookpit: what is "Before Image" and "After Image" related to Delta ?

    Someone mentions "Before Image" and "After Image" which is related to Delta method in source systems.  Someone know what they mean?
    Thanks

    Before Image and After Image are different Record modes present.
    Before Image :
    Lets assume the data present in the Cube and ODS is
    Doc No --Mat Type --- QTY
    120 -
    M01----
    10
    Now let assume that the data has changes and the quatity has to be changed from 10 to 8.This can be done in different way depending on if we are using a Cube or ODS.
    If its a Infocube . i.e it is additive so we can send the before image and the after image together
    Eg:
    Doc No -
    MAT type -
    QTY
    120--M01--
    -10
    120--M01--
    8
    If the Data Source sends both the before image and the after image, this combination can be loaded in any cube or ODS target. For ODS targets, if Overwrite setting is made, then only the after image(the last one) will make it to the Activation queue table of the ODS. If the ODS is set to Addition then both before and after image are needed to make a correct load to the target.

  • Difference between Before aggregation and After aggregation

    Hello ,
       Can any one tell me what is d difference between Before and after aggregation of calculated key figure?
          Thanks,
    Aparna

    Before aggregation calculates the data before summarizing the final results while after aggregation, it will summarize the result first before it calculates.
    Assume:
    Customer#----
    Orders
    10000----
    10
    10001----
    20
    10000----
    30
    if you want to count the number of customers before aggregates and after aggregates gives you different result.
    Before aggregates will give you
    Customer#----
    Count
    10000----
    2
    10001----
    1
    After Aggregates will give you
    Customer#----
    Count
    100000----
    1
    100001----
    1
    Customer might not be a good example but the concept remains the same for others.
    thanks.
    Wond

  • Difference between Before INSERT and After INSERT trigger?

    What is difference between Before INSERT and After INSERT triggers? Can anyone give me a simple example from SCOTT schema for both of these triggers.

    The documentation gives a good explanation have you looked at....
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_triggers.htm#sthref1175

  • Different LOV behavior between SQL query data model and data template

    I have noticed different behavior when using parameters linked to list of values (LOV) of type menu with the multiple selection option enabled and a SQL query data model vs a data template. Here's the example because that first sentence was probably really confusing.
    SQL Query:
    select
    plmc.MonthCode, plmc.ModalityDim, plmc.ModalityName,plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(:modalityDim,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (:modalityDim)
    then 1
    else 0
    end
    end
    Putting BI Publisher into debug mode, defining a data model of type SQL Query, defining a parameter called :modalityDim linked to a LOV that allows multiple selections, and selecting a couple of values from the LOV the output of the prepared statement is:
    [081607_122647956][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?,?)
    then 1
    else 0
    end
    end
    [081607_122647956][][STATEMENT] 1:6
    [081607_122647956][][STATEMENT] 2:7
    [081607_122647956][][STATEMENT] 3:6
    [081607_122647956][][STATEMENT] 4:7
    [081607_122654713][][EVENT] Data Generation Completed...
    [081607_122654713][][EVENT] Total Data Generation Time 7.0 seconds
    Note how the bind variable :modalityDim was changed into two parameters in the prepared statement.
    When I use this same SQL Query in a data template the output is:
    [081607_012113018][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?)
    then 1
    else 0
    end
    end
    [081607_012113018][][STATEMENT] 1:'6','7'
    [081607_012113018][][STATEMENT] 2:'6','7'
    [081607_012113574][][EXCEPTION] java.sql.SQLException: Syntax error converting the nvarchar value ''6','7'' to a column of data type int.
    Note the exception because it is trying to convert the multiple parameter values.
    Am I doing something completely wrong here? I really need to use a data template because I will need to link a couple of queries together from different database vendors.
    -mark

    This is for 10.1.3.4 - because in 11g every SQL query is automatially part of a data model.
    In 10g SQL query is for simple unrelated SQL queries.
    If you need to use advance features such as:
    a) multiple SQL queries that are joined in master-detail relation ships
    b) before/after report triggers
    Then you will need to use the data template, which is an XML description
    of the queries, links, and PL/SQL calls.
    hope that helps,
    Klaus

  • SQL Query takes 7 hours after upgrade to 10g

    the following query executes in under a minute in 9i, however once upgraded to 10g it takes 7 hours. The query is designed to select the data row with the max date value for the selected criteria (there are multiple rows that match the below criteria with different dates)
    I have tested in a lower environment the setting of "_optimizer_cost_based_transformation"=off and this corrects the problem. I do not feel comfortable setting this parameter session or system wide to provide a solution
    We are running Oracle 10gR2 on Solaris
    select "INSTN_ID_N",
    "MEAS_D",
    "FEED_TYPE_C",
    "FREQ_C",
    "STAT_LVL_C",
    "TS_D",
    "IX_INSTN_ID_C",
    "ENTI_TYPE_C",
    "CNTXT_ID_C",
    "CNTXT_C",
    "IX_CNTXT_ID_C",
    "VND_C",
    "PRCS_C",
    "USR_ID_C",
    "STAT_C",
    "OVRD_RSN_C",
    "LD_DT_D",
    "UPD_USR_C",
    "UPD_TS_D",
    "INS_USR_C",
    "INS_TS_D",
    "DEL_FLG_C"
    from IDA.V_INSTANCE_STATUS M
    where
    TS_D =
    select max (TS_D) from IDA.V_INSTANCE_STATUS
    where
    INSTN_ID_N = M.INSTN_ID_N AND
    MEAS_D = M.MEAS_D AND
    FEED_TYPE_C = M.FEED_TYPE_C AND
    FREQ_C = M.FREQ_C AND
    STAT_LVL_C = M.STAT_LVL_C AND
    IX_INSTN_ID_C = M.IX_INSTN_ID_C
    )

    user638113 wrote:
    the following query executes in under a minute in 9i, however once upgraded to 10g it takes 7 hours. The query is designed to select the data row with the max date value for the selected criteria (there are multiple rows that match the below criteria with different dates)
    I have tested in a lower environment the setting of "_optimizer_cost_based_transformation"=off and this corrects the problem. I do not feel comfortable setting this parameter session or system wide to provide a solutionIf you're sure that the "lower" environment reproduces the same issue, and not due to some other differences (different statistics, parameters etc.), then you could share the two different execution plans generated via DBMS_XPLAN.DISPLAY having the cost based transformations turned on and off. Make sure you use the \ tags before and after the plan output to format it in fixed font. You can use the "Quote" button in the message editor to see how to use the tag.
    Furthermore a optimizer trace (10053) might reveal why the cost based transformations lead to such an result.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Before update and after Update trigger

    Hi,
    I am following the below approach to overcome ORA-04091: table XXXX is mutating error.
    1. In the after update row level trigger i am capturing rowids of changed rows into a table type (of type rowid) defined in a package.
    2. In the after update statement level trigger i am using the data from the table type ( that got populated in the first step) to do my work.
    3. In the before update statement level trigger i am resetting the table type defined in the package.
    Now, can the below situation occur causing the system to fail
    1. A Update to the table occurred causing the before update statement level trigger to fire and reset the table type.
    2. After that row level after update trigger gets executed and captures the required data.
    3. Now before the after update statement level trigger gets executed a new update to the table happened ( to some other row as multiple users are using the application) causing the
    before update statement level to fire and erase the data from the table type?
    I want to know if above situation can occur or is the execution or before and after update triggers atomic?
    Thanks for helping.
    TIA
    Harsha

    A collection in a package is local to the session. And a given session can be processing one SQL statement at a time. So any concurrent updates would be happening in a different session with a different logical collection.
    You may encounter problems if your session is trying to update the same rows that other sessions are trying to update (whether via the original update statement or via the updates issued by the trigger). You could encounter performance problems because of row level locks or you could encounter deadlocks. But your session's collection won't be initialized by some other session's actions (other than DDL that replaced the package itself).
    Justin

  • SQL query with JSP and WML-parameters

    Hey,
    Could you help me?
    I'm trying to do the following. WML deck card 1 send parameter to same WML deck's card help. I try to read the parameter with JSP in card help by putting the parameter to SQL query, but it doesn't work. I can read the parameter with WML in card help. I can also print the value of the parameter with JSP if I generate WML with JSP.
    /*parameter sending from card 1 to card help*/
    out.println("<go href='#helpcard'>");
    out.println("<setvar name='valittukurssi' value='$(valittukurssi)'/>");
    /*parameter read with WML in card help */
    <p>Valitse kurssi.
    $valittukurssi</p>
    /'parameter read with JSP by generating WML with JSP*/
    out.println("<p>$valittukurssi</p>");
    /* SQL query with JSP */
    ResultSet uudettulokset = uusilause.executeQuery("select * from kurssi where lyhenne='$valittukurssi'");
    Thanks,
    Rampe

    You're problem is easy to fix. You're confusing WML variables with JSP variables. See below:
    >
    /*parameter sending from card 1 to card help*/
    out.println("<go href='#helpcard'>");
    out.println("<setvar name='valittukurssi'
    value='$(valittukurssi)'/>");
    Above you set a var that will work on the phone, not in JSP.
    /*parameter read with WML in card help */
    <p>Valitse kurssi.
    $valittukurssi</p>
    Yes the above does display the parameter, because it is a client side WML var, but you cannot use this variable in the JSP code (that's why your SWL fails).
    /'parameter read with JSP by generating WML with
    JSP*/
    out.println("<p>$valittukurssi</p>");Here's you're problem, the above line is EXACTLY the same as the one before it. When the container parses through this JSP code it translates the above line to:
    <p>$valittukurssi</p> on the WML page and the CLIENT uses it's local variable to display it.
    What you need and want is to have a variable that can be used in JSP code and output to your WML page. Here's how it's done:
    out.println("<go href='#helpcard'>");
    String some_name = "valittukurssi";
    out.println("<setvar name='"+some_name+"'
    value='$("+some_name+")'/>");
    //note that you may have to escape the ( and ) with a \
    //so we displayed the variable above into the WML page, now we can use it in the SQL query:
    /* SQL query with JSP */
    ResultSet uudettulokset =
    uusilause.executeQuery("select * from kurssi where
    lyhenne='"+some_name+"'");//the end of the command is: " ' " ) ;
    Frank Krul
    Got Node?

  • Having troubles passing values of Shuttle control to SQL Query of Report and Chart Region

    Hello,
    I am very new to APEX and need help for one of the Pa.I have a shuttle control on my page which populates Categories. Once user selects Categories from this control, I wish to pass the values to following SQL query :
    select * from emp_class where category IN ( LIST of VALUES FROM RIGHT SIDE SHUTTLE).
    I tried various ways of doing this including writing a java scripts which reads shuttle value, converts it into below string
    'Category1',Category2',Category3'. Then I set this value to a text box. And then I was expecting that below trcik would work
    select * from emp_class where category IN (:TXT_VALUES)
    I am sure this is not right way and hence its not working. Can you please guide me here with options?
    Many Thanks,
    Tush

    b96402b4-56f7-44ba-8952-fb82a61eeb2c wrote:
    Please update your forum profile with a real handle instead of "b96402b4-56f7-44ba-8952-fb82a61eeb2c".
    I am very new to APEX and need help for one of the Pa.
    Don't understand what this means. What is "Pa"?
    select * from emp_class where category IN (:TXT_VALUES)
    I am sure this is not right way and hence its not working. Can you please guide me here with options?
    This is a common fallacy. In
    select * from table where columnvalue in (7788, 7839, 7876)
    (7788, 7839, 7876) is an expression list and the predicate is evaluated as a membership condition.
    In
    select * from table where columnvalue in :P1_X
    :P1_X is a scalar string, incapable of containing multiple values.
    In an APEX standard report, a PL/SQL function body returning an SQL query report source with lexical substitution can be used to produce a "varying IN-list":
    return 'select * from table where columnvalue in (' || :P1_X || ')';
    where P1_X contains fewer than 1000 values, has been sanitized for SQL injection, and string values are properly quoted.
    Some people suggest the following approach, which will also work in APEX interactive reports:
    select * from table where instr(':' || :P1_X || ':', ':' || columnvalue || ':') > 0
    However this is non-performant as it eliminates the possibility of the optimizer using indexes or partition pruning in the execution plan.
    See varying elements in IN list on Ask Tom, and emulating string-to-table functionality using sql for efficient solutions.

  • Learning SQL Query with JCheckBox and JButton

    Hello,
    I am learning how to access a very simple Access table. I am able to connect to the database and return a simple query. As I make it more complicated is where I have confused myself. The program is suppose to allow the user to pick any field they want to query using JCheckBox. After they have checked the fields off, the run query button is hit and outputs the results in a JOPtion Pane with a JTable. I am trying to do a test run and I can't make the query at least output something. If I can get any clues to the right direction would be appreciated. Thanks.
    package mypackage25;
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class QueryAddressBook extends JFrame
        private JLabel selectQueryLabel;
        private JCheckBox firstName, lastName,
                       telephone, addressI, addressII, city,
                       state, zip;
        private JPanel selectQueryPanel, checkBoxPanel, executePanel;
        private JButton runQueryButton, clearSQLButton;
        private Connection connection;
        private Statement statement;
        private ResultSet resultSet;
        public QueryAddressBook()
          super("Query an Address Book");
          //Driver and Connection
          try
          //Driver for MicrosoftAccess
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          //Inform the user that the Driver was loaded successfully
          System.out.println("Driver Loaded");
          //Connect to specific database(i.e. MyAddress3) in Access
          Connection connection=DriverManager.getConnection("jdbc:odbc:MyAddress3");
          //Inform User
          System.out.println("Database connected");
          }//end try
          catch(ClassNotFoundException cnfe)
            cnfe.printStackTrace();
          }//end catch
          catch(SQLException sqle)
            sqle.printStackTrace();
          }//end catch
          //get content pane and set its layout
          Container container=getContentPane();
          container.setLayout(new BorderLayout());
          //GUI Components
          selectQueryLabel=new JLabel("Select Fields to be Queried");
          firstName=new JCheckBox("First Name");
          lastName=new JCheckBox("Last Name");
          telephone=new JCheckBox("Telephone");
          addressI=new JCheckBox("Address I");
          addressII=new JCheckBox("Address II");
          city=new JCheckBox("City");
          state=new JCheckBox("State");
          zip=new JCheckBox("Zipcode");
          //register listeners for JCheckBoxes
          CheckBoxHandler handler=new CheckBoxHandler();
          firstName.addItemListener(handler);
          lastName.addItemListener(handler);
          telephone.addItemListener(handler);
          addressI.addItemListener(handler);
          addressII.addItemListener(handler);
          city.addItemListener(handler);
          state.addItemListener(handler);
          zip.addItemListener(handler);
          //set up selectQueryPanel
          selectQueryPanel=new JPanel();
          selectQueryPanel.setLayout(new FlowLayout());
          selectQueryPanel.add(selectQueryLabel);
          //set up CheckBox Panel
          checkBoxPanel=new JPanel();
          checkBoxPanel.setLayout(new FlowLayout());
          checkBoxPanel.add(firstName);
          checkBoxPanel.add(lastName);
          checkBoxPanel.add(telephone);
          checkBoxPanel.add(addressI);
          checkBoxPanel.add(addressII);
          checkBoxPanel.add(city);
          checkBoxPanel.add(state);
          checkBoxPanel.add(zip);
          //set up execute panel
          executePanel=new JPanel();
          executePanel.setLayout(new FlowLayout());
          //set up buttons
          runQueryButton=new JButton("Run Query");
          clearSQLButton=new JButton("Clear SQL");
          runQueryButton.addActionListener
            new ActionListener()
              public void actionPerformed(ActionEvent event)
                if(event.getSource().equals(runQueryButton))
                  runSQLQuery();
          executePanel.add(runQueryButton);
          executePanel.add(clearSQLButton);
          container.add(selectQueryPanel, BorderLayout.NORTH);
          container.add(checkBoxPanel, BorderLayout.CENTER);
          container.add(executePanel, BorderLayout.SOUTH);
          setSize(800,150);
          setVisible(true);
        public static void main(String args[])
          QueryAddressBook dwgui=new QueryAddressBook();
          dwgui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }//end main
        //private inner class for ItemListener event handling
        private class CheckBoxHandler implements ItemListener
          public void itemStateChanged(ItemEvent event)
          }//end method itemStateChanged
        }//end private inner class CheckBoxHandler
        private void runSQLQuery()
          String output="";
          try
            statement=connection.createStatement();
            resultSet=statement.executeQuery("select firstName from address");
            while(resultSet.next())
              output+=resultSet.getString(1)+"\n";
            JOptionPane.showMessageDialog(null,output);
            System.out.println(output);
          }//end try
          catch(SQLException sqle)
            sqle.printStackTrace();
          }//end catch
        }//end runSQLQuery
    }//end class

    At present your query string is
    "Select firstName from Address"
    Instead of using the above hardcoded string, try to build the
    query String using logic that checks which check boxes are selected
    by the user.
    Example..
    String query = "SELECT ";
    if (firstName.isSelected()) {
    query = query + " firstName";
    Be sure, you add the comma properly between two fields :-)

  • How to determine estimated cost of dynamic SQL queries before execution?

    Hi Performance Gurus,
    Does anybody need know of a function module or program which can give me an estimated cost for a given SQL query. SQL query is a dynamic query and we need to know the estimated cost before we execute it.
    Cheers
    Jiby
    Moderator message: subject corrected, in the future please use one that describes your problem better.
    Edited by: Thomas Zloch on Aug 24, 2010 12:56 PM

    Hi,
    The mentioned function module does not give you the cost but the plan.
    On DB2 e.g.
    U Explanation of query block number: 1   step: 1
    D Query block type is SELECT
    S Performance appears to be bad
    S No index is used. Sequential tablespace scan
    E Method:
    D           access new table.
    D           data pages are read in advance
    D           pure sequential prefetch is used
    D           new table:
    D                       SAPD8M.DD02L
    D                       table space locked in mode:  N
    D           Accesstype: sequential tablespace scan.
    I think there is some information that could be used as well (cost figure transformed to text)
    S Performance appears to be bad
    S No index is used. Sequential tablespace scan
    But as already said: the whole requirement is quite strange...
    I'm not aware of any other options, sorry.
    Kind regards,
    Hermann

Maybe you are looking for

  • Is there a way to name the .indd files created by a data merge with values in the CSV file

    I have a data merge document that is set to single Record per Document page and 1 page per document.  In my CSV file I have a field for Part Number.  If I run a data merge with 10 records I end up with 10 .indd files.  I need a way so that the result

  • Photos on iphone 5c as well as my ipad?

    I would like to have all my photos on my Iphone 5c and Ipad 2 to be synced the same.  Could someone help me with the process of how this is done.  Thank you!

  • Consuming web services with Attachments

    Hello, I need to consume a web service with attachements (mime type) from sap was j2ee 7.0 (nw2004s). When I try to generate the web service deployable proxy using nwds (version 7.0.06), I get the following error message "Invalid WSDL or WSDL not fou

  • HTTPS: Error RWB components monitoring

    Hi After implementing HTTPS, when trying display component monitoring in RWB, the follwoing error displayed. Error during communication with System Landscape Directory: Unable to open SSL connection to host "myhost.mydomain.com:50101". Server certifi

  • Restriction of back ground from end user

    Hi all, i am ABAPer, but i need  to work on authorization issue, I have to restrict our FI End users (8 users) from the back ground job, At present scenario is they can run others job also in SM35 including thier job, recently our company aduit found