How to view the SQL statement generated during execution of the BW Query?

Dear Experts,
I am trying to retrieve data in a SAP BW Query from a Non-SAP system.
I think if I am able to see the complete SQL statement that was generated when I executed the BW Query, I may be able to use it to retrieve the data.
Do you know how and where I can see the SQL statement of a BW Query's SQL statement?
I tried RSRT options to execute the Query but still could not find the SQL statement.
Thanks in advance.
Regards,
Shunhui.

hi
goto rsrt
give your query name
select execute + debug option
in the debug option under data manager check the check box "display SQL/BIA query
selcet continue
you can see the sql statement
thanq

Similar Messages

  • The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]:

    Hello all together,
    actually I try to implement an user interface for using BRTools from a J2EE Application.
    I created a datasource-alias "BRTOOLS" using netweaver administrator.
    inside the implementation i execute the following code:
    DataSource ds = (DataSource) ctx.lookup("jdbc/BRTOOLS");
    Connection con = ds.getConnection();
    String query = "select * from SDBAH;";
    Statement stmt = con.createStatement();
    try {
       ResultSet rs = stmt.executeQuery(query);
    As the result I get the following message:
    The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
    Using SQLplus or dbconsole I can see and use the table SDBAH. The table scheme is "SAPSR3DB"which is the standard scheme for J2EE.
    If I try:
    select * from SAPSR3DB.SDBAH;
    I get the same result.
    What is wrong in my constellation?
    Thank you very much in advance.
    Greetings Stephan

    Dear Yordan,
    yes I did a restart of the whole system.
    If I do a wrong lookup:
    e.g:
    DataSource ds = (DataSource) ctx.lookup("jdbc/BRToolsFailure");
    where Alias  "BRToolsFailure" does not exist, I get
    Object not found in lookup of BRToolsFailure.
    So I think that the Alias of the default data source is right and visible.
    Next try:
    I use an already existing alias "ADS" in my code and get the same message:
    The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
    If I extend the tablename with the scheme-name "SAPSR3DB" I get the following:
    The SQL statement "SELECT * FROM "SAPSR3DB"."SDBAH"" contains the semantics error[s]: - 1:24 - the table or view >>SDBAH<< does not exist
    When I use SQLPLUS SAPSR3DB/password and call:
    select * from SDBAH;
    I get a result like expected.
    Thanks a lot,
    Stephan

  • How to put the SQL-statement returned value into the field (as a default)

    Hi,
    I am using Developer/2000 (Forms Designer) under windows 98.
    Please tell me how to put the SQL-statement value (as a default value) into the field before enter-query mode. Noted that I have tried the following ways but still some problems:-
    1) Place the SQL-statement into PRE_QUERY trigger in the form/block level.
    There is a message box which ask 'Do you want to save the changes?'.
    2) Place the SQL-statement before execute enter_query. There is still a
    message box which ask 'Do you want to save the changes?'.
    Any hints? Thanks. Urgent.

    solved it!
    1) Suppress DEFAULT save message
    if form_failure then
    raise form_trigger_failure;
    end if;
    2) Place the default value before enter-query.
    Ref: Title='Default value in query field in ENTER_QUERY mode' in designer forum by CVZ
    form level trigger
    ============
    WHEN-NEW-ITEM-INSTANCE
    =======================
    if :system.mode = 'ENTER-QUERY' then
    :block.item := 'default waarde';
    end if;
    3) Suppress the changes whenever leaving the default field.
    if :block.item is null then
    -- assign statement
    end if;

  • Query to find the the sql statements

    Hi,
    Oracle Version: 10.2.0.3
    Can any one please help me how to find which sql statements generate the error "OPEN CURSORS EXCEED ".
    Thanks & Regards,
    Poorna Prasad.S

    1) export the table, drop the table, create the table definition in the new
    tablespace, and then import the data (imp ignore=y).
    2) Create a new table in the new tablespace with the "CREATE TABLE x AS
    SELECT * from y" command:
    CREATE TABLE temp_name TABLESPACE new_tablespace AS SELECT * FROM real_table;
    Then drop the original table and rename the temporary table as the original:
    DROP TABLE real_table;
    RENAME temp_name TO real_table;
    3) Use the one mentioned in previous reply.
    After #1 or #2 is done, be sure to recompile any procedures that may have been
    invalidated by dropping the table.

  • Sqlplus - hiding the SQL statement

    When I run sqlplus to spool a report, it always prints out the original SQL statement in the report, but I only want the results. For example, the following script:
    SET PAGESIZE 0
    SET FEEDBACK OFF
    SPOOL report.log
    SELECT * FROM employees;
    SPOOL OFF
    prints out not only the results, but also the SQL statement "SELECT * FROM employees;" in the report. How do I hide the SQL statement from the report?
    Thanks.

    the set echo off will work if you run your select-script from a batch-file.
    (the batch-file call an other file with the select statement)
    ~
    pascal

  • Execute the sql statement stored in table

    friends i m in complication that, how can i execute sql statement which is stored in database table.
    how can i fetch that particular statement from table and make it execute!!!
    Thanks in advance

    I think we should stop at this point and have a little think.
    My understanding is that your plan is to do the following
    -Execute a Dynamic SQL statement which is constructed from values in several columns in a table (Bad idea to begin with)
    -The result of the execution is then loaded into PL/SQL.....not sure how you are handling different column lists but I'll assume you are not having to convert every column value to a VARCHAR2
    -The values returned are then used in an INSERT statement
    So basically your goal here is to take some data from one table and insert it into another table by moving data from SQL to PL/SQL then back to SQL in an elaborate, dynamic way. This is a costly waste of resources and will not scale (this is before we get to the problem of having to read the SQL statement from a table in the first place)
    I would recommend looking the INSERT SELECT statement here: http://psoug.org/reference/insert.html
    This will get the job done in one go. If you really do need it to be dynamic (which you don't, trust me) then you can still store this statement in your "dynamic SQL" table and execute it using EXECUTE IMMEDIATE although I can say for sure that you're going to run into more problems down the line with this architecture, it won't scale very well, and you'll probably waste at least *1* day of your time every week trying to fix a bug caused by the removal of a table, change to a column name etc.......
    However if you believe that storing SQL in a table is the best solution to your problem then go ahead.....at least when you find out that it isn't you'll have learned a valuable lesson.

  • What would be the SQL statement?

    What would be the SQL statement to pull data from the current week that the data was queried, regardless of what day of the current week that you queried the data?

    WHERE Date_Col >= TRUNC(SYSDATE, 'DY')
    Note that the first day of the week depends on national settings:
    SQL> alter session set nls_territory = 'AMERICA';
    Session altered.
    SQL> SELECT TRUNC(SYSDATE, 'DY') FROM DUAL;
    TRUNC(SYS
    20-JAN-08
    SQL> alter session set nls_territory = 'GERMANY';
    Session altered.
    SQL> SELECT TRUNC(SYSDATE, 'DY') FROM DUAL;
    TRUNC(SY
    21.01.08Regards,
    Dima

  • Logging/viewing SQL statements generated by the SQL Developer IDE?

    I know it is possible to view the SQL statements that the SQL Developer IDE generates to fetch result-sets from the database whenever one performs any action - say expanding the "Tables" node for a database, for example. I would appreciate if someone could point out how this functionality could be enabled.
    Thanks,
    RG

    In 1.0, you could use the AddVMOption -Daudit.trace=db_api option inside the sqldeveloper.conf file.
    In 1.1 however, I don't get output inside the console anymore (for expanding trees, etc.).
    Kris, has this option been replaced by another one? Please let us in on all the fun ;-)
    K.

  • How do i see the sql statements that are run ?

    i want to see (in a log file) what are the sql statements that oracle had ran.
    how do i do it ? what configurations should i do ? how ?
    please help ... thanks

    Current SQL statements are viewed in dynamic tables:
    SELECT SCHEMANAME, SQL_ADDRESS, SQL_TEXT, last_call_et
    FROM V$SESSION, V$SQLAREA
    WHERE V$SESSION.SQL_ADDRESS=V$SQLAREA.ADDRESS
    A historical log of all SQL statements is recorded in Oracle Archived Logs, and can be viewed using the Oracle Logminer approach. This process requires your database to be in ARCHIVELOG mode, and that Logminer be configured to read the archived logs.

  • Toplink generate the SQL statement correctly but it does not return any row

    Hi
    I faced an strange problem when using Toplink as JPA provider. Following snippet shows how I create and execute a query using Toplink JPA:
    q = em.createQuery("SELECT B FROM Branch B WHERE B.street LIKE :street");
    q.setParameter("street", "'%a%'");
       List<Branch> l = q.getResultList();
      System.out.println("List Size: " + l.size());The SQL statement resulted by this query is as follow (according to the generated log file)
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST (? AS VARCHAR(32672) ))
      bind => [%a%]Problem is that List size is always 0, independent of what I provide as parameter. I tried and executed the generated SQL statement in the SQL manager and I got some tens of record as the result. The SQL statement i tested in the SQL manager is like:
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST ('%a%' AS VARCHAR(32672) ))Can someone please let me know what I am missing and how I can fix this problem?
    Thanks.

    Hi,
    Thank you for reply.
    All data are stored in lower case so, the case sensitivity is not a problem. I am wondering how the generated query works fine when I execute it in the sql manager but it return no result when it is executed by the JPA.
    Thanks for looking into my problem.

  • Check the sql statement of view

    HI All
    I have a query that
    How can we check the SQL statement of any view in oracle 10.
    If any one knows then pls let me know

    SQL> select view_name,text from user_views where VIEW_NAME='HISTORY';
    VIEW_NAME
    TEXT
    HISTORY
    select
    Serial,
    0 State,
    Availablet At,
    AvailableD

  • Error when generating the SQL statement while running the Query

    Hello SDN Mates,
    Am using three cubes in one infoset and build a query on that. Intially it was running fine, but now am getting error generating the SQL statement. Can you please throw some light on this. Your idea would be highly appreciated.
    Thanks and Regards
    Arun S

    Hi Arun
    is there any change in the objects (Check also the consistency of infoobject ) included in infoset, just make sure those are active, open the query in designer and check if no error/warning message are present
    Thanks
    Tripple k

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • How Can I Retrieve SQL Statement From The User ?

    Hi
    I want to know, how can I make the user can enter the SQL statement from himself ?? in this code he can't enter it. Only he can display the SQL that i wrote it...
    this is my Code:
    import java.sql.*;
    public class db_testing {
         static final String DRIVER = "com.mysql.jdbc.Driver";            
         static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
         public static void main(String[] args) {
              Connection cn=null;
              Statement st= null;
              ResultSet rset=null;
              try{
                   Class.forName(DRIVER);
                   cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
                   st=cn.createStatement();
                   rset=st.executeQuery("select * from employee");
                   ResultSetMetaData metadata=rset.getMetaData();
                   System.out.println("The begining: ");
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(metadata.getColumnName(i)+"\t");
                   System.out.println();
                   System.out.println();
                   while(rset.next()){
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(rset.getObject(i)+"\t\t");
                   System.out.println();}
              catch(Exception e){
                   e.printStackTrace();
              finally{
                   try{
                   cn.close();
                   st.close();
                   rset.close();
                   catch(Exception e1){
                        e1.printStackTrace();
    }

    The following changes in the code will make the user to give the input
    import java.sql.*;
    public class db_testing {
    static final String DRIVER = "com.mysql.jdbc.Driver";
    static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
    public static void main(String[] args) {
    Connection cn=null;
    Statement st= null;
    ResultSet rset=null;
    try{
    Class.forName(DRIVER);
    cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
    // st=cn.createStatement();
    // rset=st.executeQuery("select * from employee");
    PreparedStatement pstmt=null;
    pstmt=cn.prepareStatement("select * from employee where id=?");
    pstmt.setInt(1,Integer.parseInt(args[0]));
    rset=pstmt.executeQuery();
    ResultSetMetaData metadata=rset.getMetaData();
    System.out.println("The begining: ");
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(metadata.getColumnName(i)+"\t");
    System.out.println();
    System.out.println();
    while(rset.next()){
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(rset.getObject(i)+"\t\t");
    System.out.println();}
    catch(Exception e){
    e.printStackTrace();
    finally{
    try{
    cn.close();
    st.close();
    rset.close();
    catch(Exception e1){
    e1.printStackTrace();
    }

  • How to write the sql statement of my finder function in cmp?

    hi,
    I create a cmp ejb from table INFOCOLUMN,and I create a my finder function ,which sql statement is :
    select * from INFOCOLUMN WHERE employee_id=id
    employee_id is a column of the table,and id is the finder function parameter.
    The error is : invalid column name
    So,how to write the sql statement.
    Thanks .

    Mole-
    Bind variables are of the form $1, $2, etc., so your query stmt should look like:
    select * from INFOCOLUMN WHERE employee_id=$1
    -Jon

Maybe you are looking for

  • HP Photosmart 7510 - loose connectivity when using Ethernet cable

    Need help! I have an HP Photosmart 7510 all-in-one printer connected to my home network via wireless. I have 1 Windows7 laptop which successfully connects to the printer via the home Ethernet network (laptop connected via cat5) - so the overall syste

  • Icons in finder do not disappear when deleted

    This is kind of hard to describe, but my finder's been acting really strange lately. Everytime i delete a file or folder in the finder the icon will not disappear completely, leaving some of the name of the file in the finder. This is really annoying

  • SQL*Loader - Skipping columns in the source file.

    Hi I have a comma delimted source file with 4 columns. I however only want to load columns 2 and 3 into my table using SQL*Loader. This seems like something that should be fairly simple but I can't seem to find any doc or examples of this. Any guidan

  • How to call DML through procedures

    Hi, I've a requirement like i have to call procedure from function,In that procedure,having so many DML operations. I am facing error like 'We can't perform DML operation inside a query'. How to eliminate this error? Any update please. Cheers, Arun.

  • Sync external MP3 with SWF

    We're developing a movie that will upon the users input select the sound source as well as input a dynamic text. When creating the FLA we placed a sample MP3 in the timeline and sync "stream" with the movie. It plays fine on both Mac and Win machines