APEX 'crawling' whilst executing a query using CONNECT BY

Hi Folks.
Anyone seen this behaviour before?
I can run this SQL (with the appropriate page item values substitued) in PL/SQL developer and I get the result in less than 0.094 seconds with a COST of 13
SELECT NULL LINK
      ,a.data_points
      ,5000 forecast_value
FROM
(SELECT to_char(trunc(add_months((SELECT iag.agreement_start_date
                                FROM   iot_agreement iag
                                WHERE  iag.iot_agreement_id =
                                       :P317_IOT_REBATE_AGREEMENT_ID)
                               ,LEVEL - 1)
                    ,'mm')
              ,'MON-RR') data_points
FROM   dual
CONNECT BY LEVEL <=
           trunc(months_between((SELECT iag.agreement_end_date
                                FROM   iot_agreement iag
                                WHERE  iag.iot_agreement_id =
                                       :P317_IOT_REBATE_AGREEMENT_ID)
                               ,(SELECT iag.agreement_start_date
                                FROM   iot_agreement iag
                                WHERE  iag.iot_agreement_id =
                                       :P317_IOT_REBATE_AGREEMENT_ID)))
MINUS
SELECT pkg_ngc_utilities.get_long_traffic_month(imps.traffic_period_id)
FROM   iot_mfs_plus_summary imps
WHERE  imps.client_master_entity_id = :P317_CLIENT_MASTER_ENTITY_ID
AND    imps.home_master_entity_id IN
       (SELECT ipy.master_entity_id
         FROM   iot_party ipy
         WHERE  ipy.iot_agreement_id = :P317_IOT_REBATE_AGREEMENT_ID
         AND    ipy.client_side = 0) -- Roaming Partner
AND    imps.visited_master_entity_id = imps.client_master_entity_id
AND    pkg_ngc_utilities.get_long_traffic_month(imps.traffic_period_id) IN
       (SELECT to_char(trunc(add_months((SELECT iag.agreement_start_date
                                            FROM   iot_agreement iag
                                            WHERE  iag.iot_agreement_id =
                                                   :P317_IOT_REBATE_AGREEMENT_ID)
                                        ,LEVEL - 1)
                             ,'mm')
                       ,'MON-RR') data_points
         FROM   dual
         CONNECT BY LEVEL <= trunc(months_between ((SELECT iag.agreement_end_date
                                    FROM   iot_agreement iag
                                    WHERE  iag.iot_agreement_id =
                                           :P317_IOT_REBATE_AGREEMENT_ID) ,
                                      (SELECT iag.agreement_start_date
                                            FROM   iot_agreement iag
                                            WHERE  iag.iot_agreement_id =
                                                   :P317_IOT_REBATE_AGREEMENT_ID)
                                    )))) a
ORDER BY to_date(a.data_points, 'MON-RR')If I use the same query in a Flash Chart the page still only takes a few seconds to display but the chart takes over a minute to display. APEX ADMIN shows the page being served in 2 - 3 seconds.
If I drop the chart and drop the query into a simple report region, the entire page takes over a minute to display.
Has anyone experienced anything similar?
This is the first time I have used CONNECT BY LEVEL in my SQL so that is my main suspect. But please remember, in SQL/Developer the query executes very quickly indeed.
Many thanks
Kind regards
Simon Gadd

Hi Simon,
I had something similar. When my code ran is SQL is took seconds, but took minutes in an ApEx page. There seems to the something strange with the way ApEx and/or the optimizer execute code via ApEx pages.
I gave my code to one of my tuning experts and they added a simple rule to force index use:
select  /*+RULE index(r AMS_REQUESTS_IDX4) */
        r.requester_name,
        r.ams_type_code_name,
        d.display_date
from
        (select TO_DATE(:P23_CALENDAR_DATE,'YYYYMMDD')-100+rownum display_date from all_objects where rownum < 300) d,
        ams_requests_v r
where
        trunc(d.display_date) between trunc(r.start_date) and trunc(r.end_date)
and        r.approval_status != 'R'       
and        to_char(d.display_date,'DY') NOT IN ('SAT','SUN')
and     d.display_date not in (select trunc(closure_date) from ams_closures)
and        (nvl(r.restricted_view_flag,'N') = 'N' or trunc(r.end_date) >= trunc(sysdate))
and     r.department_id in (        select
                                        d.department_id
                                from
                                        ams_departments d
                                connect by ( PRIOR DEPARTMENT_ID = PARENT_DEPARTMENT_ID)
                                start with department_id = (
                                                                select
                                                                        department_id
                                                                from
                                                                        ams_departments
                                                                where
                                                                        nvl(terminating_dept_flag,'N') = 'Y'
                                                                and         level = (select
                                                                                        min(level)                                                       
                                                                                 from
                                                                                        ams_departments
                                                                                where
                                                                                        nvl(terminating_dept_flag,'N') = 'Y'
                                                                                        connect by department_id = prior parent_department_id
                                                                                        start with department_id = :P0_DEPARTMENT_ID)
                                                                connect by department_id = prior parent_department_id
                                                                start with department_id = :P0_DEPARTMENT_ID))        
UNION
select  /*+RULE index(r AMS_REQUESTS_IDX4) */
        r.requester_name,
        r.ams_type_code_name,
        d.display_date
from
        (select TO_DATE(:P23_CALENDAR_DATE,'YYYYMMDD')-100+rownum display_date from all_objects where rownum < 300) d,
        ams_requests_v r
where
        trunc(d.display_date) between trunc(r.start_date) and trunc(r.end_date)
and        r.approval_status != 'R'       
and     to_char(d.display_date,'DY') NOT IN ('SAT','SUN')
and     d.display_date not in (select trunc(closure_date) from ams_closures)
and     nvl(r.restricted_view_flag,'N') = 'Y'
and     r.department_id in (        select distinct
                                        d.department_id
                                from
                                        ams_departments d
                                connect by ( PRIOR DEPARTMENT_ID = PARENT_DEPARTMENT_ID)
                                start with department_id in (
                                                                select
                                                                        department_id
                                                                from
                                                                        ams_departments_v
                                                                where
                                                                        :P0_PERSON_ID in (manager_id, deputy_id,administrator_id)))       
UNION
select
        NULL                              requester_name,
        t.name                            ams_type_code_name,
        trunc(c.closure_date)             display_date
from
        ams_closures c,
        ams_closure_type_codes_v t
where
        c.AMS_CLOSURE_TYPE_CODE = t.AMS_CLOSURE_TYPE_CODE   
order by 3,1It might be worth you trying something similar.
best regards,
Martin

Similar Messages

  • Execute a query using ABAP  (XSLT transformation issue)

    Hello,
    I made the steps from this blog (part I, II and III).
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    When trying to run the XSLT transformation, I got the message that : XML invalid source file.
    I am not sure what are the steps for running a transformation, or running it for this case ,maybe something it's not ok. I just run it, did not provide any information.
    Any suggestions ? Did anyone use the function module described in this blog ?
    Thank you very much in advance.

    try giving
    CALL TRANSFORMATION (`ID`)
    SOURCE meta = meta_data[]
    output = <ltable>[]
    RESULT XML xml_out
    OPTIONS xml_header = 'NO'.
    and check - sometimes the codepages configured in the BW system tend to cause an issue... I am not sure if the syntax is right though - but you are basically trying to bypass any encoding that is happening in the query transformation....
    http://www.sapetabap.com/ovidentia/index.php?tg=fileman&sAction=getFile&inl=1&id=4&gr=Y&path=ABAP%2FABAPENANGLAIS&file=ABAP-XML+Mapping.pdf&idf=41
    Edited by: Arun Varadarajan on May 18, 2009 11:28 PM

  • Execute BW query using ABAP

    Hello ,
    1) I used the function module from this link :
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    When I run it , I see the metadata correct and this is all. No more data to display.
    2) Then I used the code from here :
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    MOVE: <variable name> TO wa_var-vnam ,
       'I' TO wa_var-sign,
       'EQ' TO wa_var-opt,
       <variable value> TO wa_var-low .
         query_variables       = var
    FUNCTION z_test_query.
      FIELD-SYMBOLS: <outtab> TYPE ANY TABLE,
        <l_line>  TYPE ANY,
        <l_field> TYPE ANY.
      TYPE-POOLS: rrx1 .
      DATA: wa_var     TYPE     rrx_var ,
            var TYPE STANDARD TABLE OF rrx_var ,
            xml_out TYPE string ,
            breturn TYPE STANDARD TABLE OF bapiret2 ,
            rpt_tech_id(50) ,
            wa_meta TYPE zbw_query_output_metadata ,
            xslt_error TYPE REF TO cx_xslt_exception ,
            is_fieldcat     TYPE     lvc_s_fcat,
            it_fieldcat       TYPE     lvc_t_fcat,
            new_table  TYPE REF TO data ,
            xslt_message TYPE string ,
            meta TYPE STANDARD TABLE OF zbw_query_output_metadata . " this structure was created in the previous part
    *fill all the variables like below.
      MOVE: 'SEM_PSG01/PSG___00000_080_V1' TO rpt_tech_id .
      APPEND wa_var TO var .
      CLEAR :xml_out .
      REFRESH breturn .
      CALL FUNCTION 'Z_QUERY_EXECUTE'
        EXPORTING
          query_name            = rpt_tech_id
        IMPORTING
          xml_out               = xml_out
        TABLES
          return                = breturn
          meta                  = meta
        EXCEPTIONS
          bad_value_combination = 1
          user_not_authorized   = 2
          unknown_error         = 3
          query_not_found       = 4
          OTHERS                = 5.
      CASE sy-subrc .
        WHEN 0 .
          CLEAR: is_fieldcat, wa_meta .
          REFRESH: it_fieldcat .
          LOOP AT meta INTO wa_meta.
            is_fieldcat-fieldname = wa_meta-fieldname.
            is_fieldcat-outputlen = wa_meta-outputlen .
            is_fieldcat-datatype = wa_meta-datatype.
            is_fieldcat-scrtext_l = wa_meta-scrtext_l.
            APPEND is_fieldcat TO it_fieldcat.
            CLEAR : is_fieldcat .
          ENDLOOP .
          IF NOT it_fieldcat[] IS INITIAL .
            CALL METHOD cl_alv_table_create=>create_dynamic_table
              EXPORTING
                it_fieldcatalog = it_fieldcat
              IMPORTING
                ep_table        = new_table.
            ASSIGN new_table->* TO <outtab>.
          ENDIF .
          TRY .
              CALL TRANSFORMATION ('Z_GPS_TR')
              SOURCE XML  xml_out
              RESULT     outtab = <outtab>.
            CATCH cx_xslt_exception INTO xslt_error.
              xslt_message = xslt_error->get_text( ).
          ENDTRY.
        WHEN 1 .
        WHEN 2 .
        WHEN OTHERS .
      ENDCASE .
    {ENDFUNCTION.
    'Z_GPS_TR' is my transformation (exactly the code from the blog).
    'Z_QUERY_EXECUTE' is the function from 1). I did not use variables for the query parameter.
    I see with  the debugger that <outtab> is filled corectly, with the values from my query.  Still , the function, when is runed normally, does not display anything.
    3) If I run only the transformation Z_GPS_TR alone, it says invalid source XM source file.
    Please, some suggestion? I don't know hot to proceed.
    Many thanks.
    Edited by: Ariana D on May 19, 2009 11:40 AM

    Hi All
    I able to solve this problem
    Regards
    Satrajit.

  • Error executing a query using a DB-Link

    Hi all,
    I'm trying to execute a query on a DB using a connection. I created a DB-LINK on the DB. executing the select:
    select sysdate from dual@lnk_db_prod;
    I get the following error:
    Error starting at line 1 in command:
    select sysdate from dual@lnk_db_prod
    Error at Command Line:1 Column:19
    Error report:
    SQL Error: ORA-01882: timezone region not found
    ORA-02063: preceding line from lnk_db_prod
    The error will be return executing any query on a db-link.
    It appens if I create a db-link using syntax referencing the SID and using the sintax with the complete connection string. Below the two example of db-link DDL commands:
    1.
    CREATE DATABASE LINK lnk_db_prod
    CONNECT TO prod IDENTIFIED BY prod
    USING 'DBPROD';
    2.
    create database link lnk_db_prod2
    connect to prod
    identified by prod
    using '(DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS =
    (PROTOCOL = TCP)
    (Host = 10.41.54.156)
    (Port = 1521)
    (CONNECT_DATA = (SID = DBPROD)
    Can you help me, please?
    bye,
    Ivan

    Hi,
    You would be better off posting / searching on other Oracle forums that deal more specifically with Application Servers. I googled "WebLogic set time_zone" and the first three hits were from our forums:
    Default TimeZone
    How to fix msg=ORA-01882: timezone region  not found
    http://kr.forums.oracle.com/forums/thread.jspa?messageID=9400587
    I hope one of the these is what you are looking for.
    Regards,
    Gary Graham
    SQL Developer Team

  • Executing Select query using JDBC Receiver Adapter

    I created couple types in Oracle and also new function instead of procedure
    Can I execute the above query using JDBC Receiver Adapter.
    select *
    from  the ( select cast( apr.get_distribut('', '', '', 'hdfcgd', 'CAN') as dsrTable )
             from dual );
    If possible how my message structure should look like...

    Hi vikram,
       If you use JDBC as Receiver Adapter you can only post the data to the data base I do no think so we can select the records from the data base.
       If you use JDBC as Sender hope,we can the select query in the sender communication channel.
        Hope I am clear.
      Thanks and Regardds,
      Chandu.

  • Executing a query using API

    Hi All
    Is there any way to query OIM database using OIM API.
    i mean excuting a custom query.
    Thank you
    sas

    To execute a query, you can use the following:
    tcDataSet tcDS = new tcDataSet();
    tcDS.setQuery(<dbRef>, <queryString>);
    tcDS.executeQuery();
    <dbRef> -> If executing from adapter, you can use tcDataProvider or if invoking from a scheduled task use 'getDataBase()'
    <queryString> -> String containing the query.
    As mentioned in earlier replies, using direct queries is not recommended, you should be using APIs instead. tcUserOperationsIntf.findUsers(Map) wil work. Then on the tcResultSet object returned you can use getRowCOunt() to determine # of rows.
    Hope this helps.
    - Aman

  • Query tuning for query using connect by prior

    I have written following query to fetch the data. The query is written in this format because there are multiple rows, which make one recrd and we need to bring that record into one row.
    For one CAT(commented here), this query takes around 4 minutes and fetches 6900 records but when it runs for 3 CAT, it takes 17 mins.
    I want to tune this as this has to run for 350 CAT values.
    It is doing FTS on the main table. I tried to use different hints like PARALLEL, APPEND (in insert) but nothing worked.
    The cost of the query is 51.
    Any help/suggestions will be appreciated.
    SELECT DISTINCT MIN(SEQ) SEQ,
    PT, APP, IT, LR, QT,CD, M_A_FLAG,
    STRAGG(REM) REM, -- aggregates the data from different columns to one which is parent
    CAT
    FROM (WITH R AS (SELECT CAT, SEQ, PT, M_A_FLAG, IT, LR,QT,CD, REM, APP
    FROM table1
    WHERE REC = '36' AND M_A_FLAG = '1'
    --AND CAT = '11113')
    SELECT CAT, SEQ,
    CONNECT_BY_ROOT PT AS PT,
    CONNECT_BY_ROOT APP AS APPL,
    M_A_FLAG,
    CONNECT_BY_ROOT IT AS IT,
    CONNECT_BY_ROOT LR AS LR,
    CONNECT_BY_ROOT QT AS QT,
    CONNECT_BY_ROOT CD AS CD,
    REM
    FROM R A
    START WITH PT IS NOT NULL
    CONNECT BY PRIOR SEQ + 1 = SEQ
    AND PRIOR CAT = CAT
    AND PT IS NULL)
    GROUP BY PT, APP, IT,LR, QT, CD, M_A_FLAG, CAT
    ORDER BY SEQ;
    Thanks.
    Edited by: user2544469 on Feb 11, 2011 1:12 AM

    The following threads detail the approach and information required.
    Please gather relevant info and post back.
    How to post a SQL tuning request - HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long - When your query takes too long ...

  • SQL query using connect by clause

    Hi,
    I have table:
    SQL> col id for 999
    SQL> col code for a30
    SQL> select id,code from t1;
      ID CODE
    704 ,2,3,7,8,
    707 ,15,12,17,18,
    742 ,23,25,27,28,
       5 ,53,65,67,58,
    4 rows selected.---
    When I run query:
    select id,
           substr(code,instr(code,chr(44),1,level)+1,instr(code,chr(44),1,level+1)-instr(code,chr(44),1,level)-1) code
          from(
            select  id,
                    code,
                    length(code) - length(replace(code,',',''))-1 len
            from t1
            where id=5)
    connect by level <= len;
      ID CODE
       5 53
       5 65
       5 67
       5 58
    4 rows selected.How to modify my query to get this output:
    ID CODE
    5 53
    5 65
    5 67
    5 58
    704 2
    704 3
    704 7
    704 8
    707 15
    707 12
    707 17
    707 18
    742 23
    742 25
    742 27
    742 28What is the best way to get this output?
    My db:
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    5 rows selected.Thanks for answers!
    Regards,
    Marko

    Hi,
    Generate a separate "counter table" that has the numbers 1, 2, 3, ... , x, where x is the greatest number you'll ever need.
    Join to this table, using a join condition that gets the exact numbers you need for each row.
    Use the number from the counter table where you are currently using LEVEL.
    That is:
    WITH     cntr      AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= ( SELECT  MAX ( LENGTH (code)
                                             - LENGTH (REPLACE (code, ','))
                           FROM        t1
                         ) - 1
    select id,
           substr(code,instr(code,chr(44),1,n)+1,instr(code,chr(44),1,n+1)-instr(code,chr(44),1,n)-1) code
    FROM   t1
    JOIN   cntr     ON     cntr.n <= LENGTH (code) - LENGTH (REPLACE (code, ','))
    ;If you're using Oracle 10 (or higher) regular expressions would simplify this a lot.

  • Error executing a query using VPD and BC4J

    Hi all,
    Our team is developing an application using an Oracle DB 9.2.0.4 and BC4J 10g (9.0.5.16.0) as persistence layer.
    We also are using the VPD (virtual private database) to have security in the database at row level.
    The problem we are facing is that every some time (days) we get a jdbc error when a query (see below) that uses VPD policies is executed. Once the error occurs I execute it from sqlplus without getting any error .. it only occurs from our java application.
    To temporary solve this problem, we delete and recreate the VPD policies, then the application continue working fine for some time ...
    I'll appreciate any comment / suggestions
    Thank in advance.
    Eduardo.
    ERROR LOG:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT CalLocation.ID,
    CalLocation.CODE, eo
    CalLocation.NAME,
    CalLocation.ZIP,
    CalLocation.PHONE,
    CalLocation.FAX,
    CalLocation.ADDRESS1,
    CalLocation.ADDRESS2,
    CalLocation.URL,
    CalLocation.OWNER,
    CalLocation.CTY_ID,
    CalLocation.DESCRIPTION,
    ORefCity.CODE CTY_CODE,
    ORefCountry.ID CTR_ID,
    ORefCountry.CODE CTR_CODE,
    ORefRegion.ID REG_ID,
    ORefRegion.CODE REG_CODE
    FROM CAL_LOCATIONS CalLocation,
    OREF_CITIES ORefCity,
    OREF_COUNTRIES ORefCountry,
    OREF_REGIONS ORefRegion
    WHERE ORefCity.ID = CalLocation.CTY_ID
    and ORefCountry.ID = ORefCity.CTR_ID
    and ORefRegion.ID = ORefCountry.REG_ID) QRSLT WHERE ( ( (CTY_ID = 867) ) )
    ## Detail 0 ##
    java.sql.SQLException: Io exception: Broken pipe
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:345)
         at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:717)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2605)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:457)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:387)

    The symptoms we have been getting are quite similar to the bug 3662364 .
    I'm going to implement the patch for that bug and see what happend then.
    Thank you very much for your help.
    Regards,
    Eduardo.

  • Recursive joins / how to define query using connect by clause

    Hi,
    I have a table A have 1-1 reltionship with table Employee
    Structure of table is as follows
    Table A
    id name employee_id
    100 aa 1
    200 bb 2
    300 cc 3
    400 dd 4
    500 ee 5
    Table Employee
    id parent_id
    1 null
    2 1
    3 2
    4 3
    5 1
    6 1
    I want to get all records from A table whose employee_id is equal to 2 or (recursive)decendants/child of employee with id 2 (i.e. employee with id 2,3,4 )
    i.e I want recursively join where in I get records from table A as
    id name employee_id
    200 bb 2
    300 cc 3 (because it is child of employee with id 2)
    400 dd 4 (becaue it is child of employee with id 3 which is child of 2)
    I know we can use In clause , but it will be performance wise not good.
    Can we do it in Toplink without using IN clause?
    Oracle has connect by clause, but other database might not have this caluse. So how can write a toplink query which can run on any database.
    Any help is highly appreciated.
    Thanks a lot.

    You can use TopLink's Hierarchical Query support but this only works with Oracle DB as it relies on the database to perform the query.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I execute a query using RSCRMBW_REPORT?

    Hi everybody,
    I have read the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3ba5e590-0201-0010-59b1-cab51fd245b7
    and found it is very intersting for my requirement.
    I copied the report,and modified it regarding our case.But during the second call,I get runtime error.
    I debugged the code, and found the error results from method GET_CUBETYPE() of class CL_RSCRMBW_BAPI.In this method,it tries to create a object which is TYPE REF TO cl_rsd_dta.
    CREATE OBJECT lr_dta
         EXPORTING
           i_infoprov    = g_s_status-infocube
    But g_s_status-infcube is null.
    I am not able to find where this 'infocube' component  in this g_s_status struction is filled,even I found,I don't know how I can give this infocube parameter from report which 2 FM are called.
    My code is following:
    parameters: p_repuid TYPE RSCRMSTATUS-REPORTUID
    DEFAULT 'Z_IC_01/Z_COMP_Q003'.
    parameters: p_split type BAPI6110DIM-DIM_NAM.
    data:name_query TYPE CHAR50,
         result_table LIKE RSCRMSTATUS-TABNAME,
         it_return LIKE BAPIRET2 OCCURS 2 WITH HEADER LINE,
         infocube TYPE CHAR30,
         compid TYPE CHAR30.
    AT SELECTION-SCREEN  ON VALUE-REQUEST FOR p_repuid.
    CALL FUNCTION 'RSZ_COMPONENT_TREE_GET'
        EXPORTING
          i_title    = 'Query auswählen'(031)
        IMPORTING
          E_INFOCUBE = infocube
          E_COMPID   = compid
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc GT 0.
      ENDIF.
    concatenate infocube '/' compid into p_repuid.
    START-OF-SELECTION.
    CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
    i_mode = 'OPEN'
    i_reportuid = p_repuid
    I_PACKSIZE = 10000
    I_EXECMODE = 'TABLE'
    I_EXTRACT = 'ZBWTEST'
    I_SPLIT = p_split
    I_CLEAREXTRACT = 'X'
    TABLES
    E_T_RETURN = it_return.
    CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
    i_mode = 'START'
    i_reportuid = p_repuid
    I_PACKSIZE = 10000
    I_EXECMODE = 'TABLE'
    I_CLEAREXTRACT = 'X'
    TABLES
    E_T_RETURN = it_return.
    So far this creation of report is only the 2nd step.But I am not sure how step 3 to step 6 should be done so that the report can be execute exactly.
    What should I do? Pleas help me!
    Thanks in advance
    Regards,
    Liying
    Message was edited by: Liying Wang
    Message was edited by: Liying Wang
    Message was edited by: Liying Wang

    Liying
    Were you able to get a solution to this problem? I am facing the same issue too. The g_s_status-infocube is showing blank.
    Regards
    Dilip

  • How to see generated SQL when execute JPQL query using entity manager?

    I want to see generated SQL query in console or in a log file. How do I do that?
    I'm using GlassFish if it matters

    If you want to see SQL query that is generated from JPQL in GlassFish console you should do following:
    Log on admin console.
    Select 'Application Server' from tree, then select Logging tab and Log Levels sub-tab.
    Log level for 'Persistence' must be set to FINE or level with more verbosity.

  • Reg : Hierarchical Query(Using Connect By)

    Hi all,
    I got the result with the hierarchical query as :
    */qxxh*
    */qxxh/jxobcbg*
    */qxxh/jxobcbg/n00wcp4*
    */qxxh/jxobcbg/n00wcp4/x000263*
    */qxxh/jxobcbg/n00wcp4/x000263/p0263*
    */qxxh/jxxocbg*
    */qxxh/jxxocbg/n00voc1*
    */qxxh/jxxocbg/n00voc1/x000589*
    */qxxh/jxxocbg/n00voc1/x000589/p0589*
    */qxxh/jxuwxxh*
    */qxxh/jxuwxxh/n00xpxf*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl/x000522*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl/x000522/p0522*
    Here I want to select only maximum path . Here I used "SYS_CONNECT_BY_PATH"
    Please let meknow how to do this ?
    Thanks in advance .
    Edited by: udeffcv on Dec 9, 2009 10:03 PM

    udeffcv wrote:
    Hi all,
    I got the result with the hierarchical query as :
    */qxxh*
    */qxxh/jxobcbg*
    */qxxh/jxobcbg/n00wcp4*
    */qxxh/jxobcbg/n00wcp4/x000263*
    */qxxh/jxobcbg/n00wcp4/x000263/p0263*
    */qxxh/jxxocbg*
    */qxxh/jxxocbg/n00voc1*
    */qxxh/jxxocbg/n00voc1/x000589*
    */qxxh/jxxocbg/n00voc1/x000589/p0589*
    */qxxh/jxuwxxh*
    */qxxh/jxuwxxh/n00xpxf*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl/x000522*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl/x000522/p0522*
    Here I want to select only maximum path . Here I used "SYS_CONNECT_BY_PATH"
    Please let meknow how to do this ?
    Thanks in advance .
    Edited by: udeffcv on Dec 9, 2009 10:03 PMwhat do you mean by maximum path?? is it...
    */qxxh/jxobcbg/n00wcp4/x000263/p0263*
    */qxxh/jxxocbg/n00voc1/x000589/p0589*
    */qxxh/jxuwxxh/n00xpxf/m00bxpl/x000522/p0522*
    is it child nodes??
    then you might like to see
    CONNECT_BY_ISLEAF pseudo column..example you can find it in below link
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/pseudocolumns001.htm#sthref670
    Ravi Kumar

  • How to execute a query uses hibernate @Formula or other JPA annotation

    Solved ! ^^

    This is the code.
    1. we can declare types dynamically
    2. Internal table dynamically
    3. Select querry dynamically
    just copy paste this code
    Here is the code for your question
    DATA:v_fieldname
    TYPE fieldname,
    l_PROG TYPE string,
    v_mess TYPE string,
    l_sid TYPE string,
    wa_ddfields TYPE dntab.
    DATA i_tab TYPE STANDARD TABLE OF string.
    DATA:l_str TYPE string,
    l_str1 TYPE string.
    PARAMETERS matnr type marc-matnr.
    end-of-SELECTION.
    *build the subroutine pool
    APPEND 'PROGRAM subpool.' TO i_tab.
    APPEND `LOAD-OF-PROGRAM.` TO i_tab.
    APPEND `DATA i_tab1 TYPE TABLE OF vbak.`      TO i_tab.
    APPEND `DATA l_rows TYPE i.`      TO i_tab.
    APPEND `select * into table i_tab1 from vbak.` To i_tab.
    append 'DESCRIBE TABLE i_tab1 LINES l_rows.' to i_tab.
    append 'Write :  l_rows .' to i_tab.
    GENERATE SUBROUTINE POOL i_tab NAME l_PROG
    MESSAGE v_mess
    SHORTDUMP-ID l_sid.
    IF sy-subrc = 0.
    PERFORM ('LOOP_AT_TAB') IN PROGRAM (l_PROG) IF FOUND.
    ELSEIF sy-subrc = 4.
    MESSAGE v_mess TYPE 'I'.
    ELSEIF sy-subrc = 8.
    MESSAGE l_sid TYPE 'I'.
    ENDIF.
    Edited by: vijay wankhade on Jan 1, 2009 5:34 PM
    Edited by: vijay wankhade on Jan 1, 2009 5:34 PM

  • Problem executing a partition query using occi in c++

    i am trying to execute a simple select query which returns a row from the table. The query is
    m_stmt->setSQL("select * from table partition(:1) where mdn = :2");
              m_stmt->setString(1,"P9329");
              //m_stmt->setInt(2,9320496213);
              ResultSet * rs = m_stmt->executeQuery();
              while(rs->next())
              cout<<"the value of preferences is aaaaaaaaaaaa"<< rs->getString(3);                    
    The problems that i am facing are as follows :
    1) if i execute the query using the actual values in the select query, it seems to be working fine, but when i try the above method to make it more dynamic (the values shown would be replaced by variables) it is giving me the following errors :
    a)if i put the partition value as a position parameter and put the mdn as the direct value in the query then it says the SQL command not ended properly
    b) if i put the partition value directly and put the mdn as a position parameter then the error is "Invalid Character "
    Any help would be much appreciated..ty in advance

    Hi Leonard,
    Thanks for letting me know that...thats pretty disappointing. Looks like I'll have to change my strategy in my implementation.
    Do you know if I can also develop functions using Acrobats SDK library methods such as "PDDocCreate()", "PDDocSave", etc. in OLE [MFC] applications?
    The reason why I ask is because I have previously created a plugin that creates a PDF file and embeds a 3D annotation... so this would be the same sort of idea that the 3D Tool Menu Item achieves.
    Now, if I were to use the function code within my OLE application, I will have to also include the PIMain.c file in my project as well correct?
    I hope this idea is a good one... please let me know if this approach is possible.
    Thanks.

Maybe you are looking for

  • Proximity Sensor Doesn´t Work. How to fix it?

    I´am experiencieng a problem that many other iphone users may either. The proximity sensor doesn´t work. When i answer a phone call, the display doesn´t turn off, and everytime i keep dialing numbers, endind calls and a lot of other little things tha

  • In clause with default_where

    hi all, i am using forms6i. i have to query a data block with in clause query Go_Block('EMPLOYEE_MASTER'); Set_Block_Property('EMPLOYEE_MASTER',Default_Where,'emp_dept IN ('''||:dept||''''||')'); Execute_Query;in my code 'dept ' is the field where i

  • Validation for FB01

    Hi Guys, I want to write a validation to restrict a specific user from accessing the tcode FB01 and FB02. how can i write the validation in GGB0. Say the user is XYZ , I want to block XYZ from accessing FB01 and FB02 in the validation. Pls suggest. T

  • Write protection error with my soundblaster live

    Running win ME and cannot fully install soundblaster software disk.Doing a complete install.When system reboots,blue screen with the "Write Protection Error".Have to shut down comp with power switch. Then when I turn it back on,it comes up in safe mo

  • Creating a "checkpoint" using RMAN

    I've got to do a significant upgrade to an application schema over the weekend. I would like to set an easy way to restore the database to the point it was in right before I started the upgrade, in case I decide I need to start over. What's the simpl