Query..no rows..

I am auditing DB users, due to some reasons my batch file didnt run successfull, now I want to check yesterday's (sysdate-1) or (03-MAR-2010) audit logs.
I have written query but its not returning any rows, please do help me.. I have tried over 15 times but unbale to post here at oracle.forums.com, so I posted another forum, u can also give me answere here. at oracle.forums.com
http://www.orafaq.com/forum/t/155619/147533/
Regards,

SELECT username                                             ,
  TO_CHAR(EXTENDED_TIMESTAMP,'fmDd-MM-YYYY HH:MI:SS AM') TIME,
  owner                                                      ,
  obj_name                                                   ,
  ses_actions "---D--I--SU-----"                             ,
  os_username                                                ,
  userhost                                                   ,
  sql_text                                                   ,
  sql_bind
   FROM DBA_audit_trail
  WHERE CAST(extended_timestamp AS DATE) LIKE sysdate-1
AND username = 'ERP'
ORDER BY TIME;you can try like this....
Ravi Kumar

Similar Messages

  • Query multiple rows

    Hi, need some help on XML and XSD.
    say I have a table in the database with 3 columns: a, b, c
    on my XDP form, I have a table, like a spreadsheet, with 3 columns too: x, y, z
    and it has 10 rows.
    I want to pre-fill the form with 10 rows of data,
    so, in my Process's action profile,
    I use JDBC's query multiple rows to get the first 10 records of my database table.
    how do I put these 10 rows of data into the table on my form?
    TIA for helping me.
    Happy New Year!

    Step1: Use SQL Query Multiple results as XML activity
    Step2: Define the output of SQL activity to look similar to
    <table>
        <row>row1 value</row>
        <row>row2 value</row>
        <row>row3 value</row>
        <row>row4 value</row>
        <row>row5 value</row>
        <row>row6 value</row>
        <row>row7 value</row>
        <row>row8 value</row>
        <row>row9 value</row>
        <row>row10 value</row>
    </table>
    Step3: arrange your forms fields (Table and rows) in the same way as mentioned above.
    Nith

  • How to query a row based on its rownum

    Dear all,
    what is the easiest way to query a row based on its rownum? Suppose I have the following query:
    select first_name from employees where rownum<5;
    FIRST_NAME
    Ellen
    Sundar
    Mozhe
    DavidSo Ellen has rownum 1, Sundar 2 and so on. How can I do it if I just want to query a row where Mozhe is the first_name, which is rownum 3?
    Best regards,
    Val

    JS1 wrote:
    Valerie Debonair wrote:
    I was thinking how oracle assign a rownum in a table is by how it populates the rows in the table.Hence a statement "based on its availability". Maybe my way of thinking it's not accurate?
    You are correct, your way of thinking is wholly innaccurate. Something that can easily be confirmed simply by reading the documentation:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/pseudocolumns009.htm#i1006297
    okie doke... thanks for the correction

  • JDBC Query Single Row service Parse Query

    Using JDBC Query Single Row service on an Oracle database,
    I specify a SQL statement like this:
    select abc, to_char(aDate, 'MM/DD/YYYY') from xyz where def = 123
    then I click the "Parse Query" button to try to map the query results to my variables, but the mapping window gives me 3 fields instead of 2:
    1. abc
    2. to_char(aDate)
    3. 'MM/DD/YYYY'
    how do I let it understand that there are only 2 fields in the results so that I can map it properly?
    thanks

    Got a new minor issue unrelated to the above, but I don't want to flood this forum with another new topic, so I'll stick this new thing here.
    I have a very simple process that only contains this JDBC Query Single Row service.
    In this query single row service, at the bottom of the property sheet, there's a section where it says "number of rows retrieved"...
    now, if I map this 'number of rows' to a variable (I set the variable's type as "int"), when I call my process (as a web service), it returns me nothing... all the output parameters are empty.
    If I remove the mapping of "number of rows", that is, there's nothing in that bottom section. Then my process works correctly, all the output variables contain correct data from my database.
    Has anybody encountered this? what's your solution please?

  • WITH Subquery Factoring OR "Scalar SubqueriesRun Another Query per row

    Hi Experts
    Please suggest
    which one query is better
    Involved table p is of size 2GB and c1/c2 of size 800M.
    And we have to run a report on p which will do FTS (no where clause on p)
    So FTS on 2 GB table and then running Another Query per row .. so results job very slow
    1)  Select p.id,
             (select sum(q1) from c1 where c1.id = p.id) c1_sum1,
             (select sum(q2) from c2 where c2.id = p.id) c2_sum2
       from p
    2)
    WITH Subquery Factoring
    with c1_vw as
    (select id, sum(q1) c1_sum1
        from c1
             group by id),
       c2_vw as
       (select id, sum(q2) c2_sum2
           from c2
          group by id),
       c1_c2 as
       (select c1.id, c1.c1_sum1, c2.c2_sum2
           from c1_vw c1, c2_vw c2
          where c1.id = c2.id )
       select p.id, c1_sum1, c2_sum2
          from p, c1_c2
         where p.id = c1_c2.id
       / 10.2..0.4
    AIX 5.3
    Thanks In Advance
    ivw

    ivw wrote:
    which one query is betterThe better query IMHO is the one that returns the the correct results in the shortest amount of time using the least system resources (the last two items usually happen at the same time). Maintainability is an issue too. Which one do you like best?
    Its hard to say which query will run best without running both, getting execution plans, and run-time statistics. At a pure guess I would think all things being equal they would have similar performance but do not really know.

  • SQL Query Single Row not working

    My workflow contain a Query Single row activity. I have added a where clause in Arabic which is not working. If I remove the Arabic condition its working.
    Is there something to do with the server?
    My server is windows 2008 R2 Server.
    The same workflow is running perfectly on another identical environment.
    Thanks for any valuable suggestions,
    Nith

    Hi Sastry,
    Connection to the database is trough Pivotal, I have tried ODBC connection as well but same error
    The instruction at "0x005d53e0" refereced memory at "0x00000014'. The memory could not be "read".
    With ODBC I have always compilation error saying
    Query Engine Error: '42000:[Microsoft][ODBC SQL Server Driver][SQL server] Incorrect syntax near the keyword 'SELECT'. '.
    but even the simple select statment is showing the error.
    Do you think the error is with Drivers???
    Regards
    Stefan

  • Cursor in select query in row to column format

    Hi
    I have the query like below
    SELECT d.department_id,
                 CURSOR(SELECT e.first_name,
                         e.last_name
                  FROM   employees e
                  WHERE  e.department_id = d.department_id
           ) emps
    FROM   depatments dI want the result set in a format of Row To columns like
    10                             20
    <cursor result>   <cursor result>pls give ur suggestions how to achieve this in a efficient way?I tried the method of "max(decode(.." but dont think so its possible with this

    vishnu prakash wrote:
    Hi
    I have the query like below
    SELECT d.department_id,
    CURSOR(SELECT e.first_name,
    e.last_name
    FROM   employees e
    WHERE  e.department_id = d.department_id
    ) emps
    FROM   depatments dI want the result set in a format of Row To columns like
    10                             20
    <cursor result>   <cursor result>pls give ur suggestions how to achieve this in a efficient way?I tried the method of "max(decode(.." but dont think so its possible with thisNumber of column of a select query is static. Must be known at the parsing time itself. But in your case i dont think the number of columns will be limited to 2 (10 and 20) there could be many more.
    You can search this forum to see how to PIVOT your data. There are lot of example. You can also try dynamic pivot. Its all in here, just search.

  • Query filtering rows in the ViewObject but works fine when run in sql

    Hello,
    The below query returns 8 rows when run in SQL Plus but the same query when used in the viewobject, its only returning 4 rows. I tried in all possible ways but not sure what's happening.
    SELECT
    tt.assignment_number,
    tt.tab_name,
    tt.old_value,
    tt.new_value,
    tt.oracle_value
    FROM TestTable tt
    WHERE tt.ppa_id = :1
    AND ((:2 IS NULL) OR (:3 = tt.old_col))
    AND ((:4 IS NULL) OR (:5 = tt.new_col))
    Any suggestions are appreciated.
    Thanks
    --KK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Try this
    OAViewObject OAViewB = (OAViewObject)OAAppl.findViewObject("DisplayDetailsVO");
    OAViewB.setWhereClauseParams(null);
    OAViewB.setWhereClauseParam(0,Integer.parseInt(Pid));
    OAViewB.setWhereClauseParam(1,Changes_Flag);
    OAViewB.setWhereClauseParam(2,Changes_Flag);
    OAViewB.setWhereClauseParam(3,Oracle_Flag);
    OAViewB.setWhereClauseParam(4,Oracle_Flag);
    OAViewB.setMaxFetchSize(-1);
    OAViewB.executeQuery();
    Thanks
    Shree

  • Query : In rows, can we split heading in two lines?

    Hi Friends !
    I know, in columns, we can split the heading in two lines.
    In Rows, characteristics " Nomination Header " is there. The output should come like:
    Nomination
    Header
    Awaiting your inputs.
    Thanks
    Rekha

    Hi,
    After entering the text <i>Nomination</i> click on enter button and type <i>Header</i> , in the query designer.
    With rgds,
    Anil Kumar Sharma .P

  • Bex Query - Show rows from another characteristic

    Hi Guys,
    I have a problem, I need to create a query to be displayed in Excel that shows accounting informacion by number, like this:
    Account         Balance
    12110201       1 USD
    12110202       1 USD
    12110204       1 USD
    That works so far, the problem is that I need to add 2 more columns and in 1 of the new columns I need to show only some accounts, like this:
    Account          Balance        NewColumn1
    12110201       1 USD      
    12110202       1 USD            Balance of 12110202
    12110204       1 USD
    the other one is more challenging because it need to show informacion from a different account, like this:
    Account          Balance        NewColumn1            NewColumn2
    12110201       1 USD      
    12110202       1 USD           Balance of 12110202
    12110204       1 USD                                           Balance of 2406910000
    the first values came from my accounts tables that contain balance from sub accounts, but the value 2406910000 is in fact a sub account value.
    Can some of you expers can help me on this? Is it possible?
    Please help.

    hmmmm
    let me ask this:
    You have multiprovider A
    in that u have Chars
    Account
    Subaccount
    Source of subaccount
    & Keyfigures
    $ amounts
    okey now, lets say u want to display the data as follow:
    $amount-----newcolumn1
    Account----
    2244--$2200--
    2245--$3200--
    bal. of 1234
    2246--$4200--
    2247--$1200-----bal. of 734
    is that what u are asking to display....
    if yes, bring Account in Rows
    bring $amount in Collumns
    add new selection1, in that add $amounts, then add Subaccounts from characteristics
    that way it will show $ for subaccount
    for e.g. in above case it will show $value for 1234 which is subaccount of 2245.
    My question is when you say "Balance of 22140000" what is that you intend to display here....you want to show $ of Balance i.e $45, $56 etc, or
    do you want to show Subaccount Number i.e 1234 or
    do u want to show specific texts "Balance of 22140000"
    my response above was related to this only, what is that you want to show in ur reports?
    what is available in ur multiprovider?
    if you wanna show specific texts  "Balance of 22140000", this cannot be done because you cannot just create texts in Query designers.
    If you wanna show specific $ amounts for that subaccount, answer is create restricted keyfigure
    if you wanna show Subaccount Number i.e 1234 etc, that means  you will have to create Replacement path variable and then replace values of Subaccount number into that column.
    Maybe you will not need cell definition then.
    i hope you understand what i am trying to explain..
    dont hesitate to reply with detailed explaination, and any questions.

  • Query regarding row in ALV

    Hi all,
            Please clarify this query of mine in alv.
    I am displaying an output in ALV format which has 10 rows.
    I want to add a eleventh row to the above output .
    The eleventh row must contain the sum of the above 10 rows .
    Please guide me how to achieve this.
    Kindly reply as fast as possible.
    Regards,
    Vijay

    Hi,
    see following code :
    REPORT ZALVTEST1 .
    TYPE-POOLS: SLIS.
    Data: v_temp type p decimals 2.
    Data: v_f1_sum type i,
    v_f2_sum type i.
    dATA: BEGIN OF struct_customer,
    CUSTOMER LIKE KNA1-KUNNR,
    FIELD1 TYPE I,
    FIELD2 TYPE I,
    field3 type i,
    END OF struct_customer.
    DATA: I_LAYOUT TYPE SLIS_LAYOUT_ALV,
    I_FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
    I_HEADING TYPE SLIS_T_LISTHEADER,
    I_EVENTS TYPE SLIS_T_EVENT.
    DATA: RS_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA: V_CUST TYPE KNA1-KUNNR.
    DATA: BEGIN OF ITAB OCCURS 0,
    CUSTOMER LIKE KNA1-KUNNR,
    FIELD1 TYPE I,
    FIELD2 TYPE I,
    field3 type i,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0,
    CUSTOMER LIKE KNA1-KUNNR,
    FIELD1 TYPE I,
    FIELD2 TYPE I,
    field3 type i,
    END OF ITAB1.
    DATA: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    DATA: FORMNAME_SUBTOTAL_TEXT TYPE SLIS_FORMNAME VALUE 'SUBTOTAL_TEXT'.
    DATA: FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
    DATA: FORMNAME_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST'.
    DATA: FORMNAME_AFTER_LINE_OUTPUT TYPE SLIS_FORMNAME VALUE 'LINE_OUTPUT'.
    START-OF-SELECTION.
    PERFORM FILL_ITAB.
    PERFORM FILL_CAT.
    PERFORM SET_SORT.
    PERFORM FILL_EVENT.
    PERFORM DISPLAY_DATA.
    END-OF-SELECTION.
    *& Form FILL_ITAB
    text
    --> p1 text
    <-- p2 text
    FORM FILL_ITAB .
    DATA: L_CTR TYPE I.
    ITAB-CUSTOMER = 1.ITAB-FIELD1 = 1.ITAB-FIELD2 = 2.APPEND ITAB.
    CLEAR ITAB.
    ITAB-CUSTOMER = 2.ITAB-FIELD1 = 3.ITAB-FIELD2 = 4.APPEND ITAB.
    CLEAR ITAB.
    ITAB-CUSTOMER = 3.ITAB-FIELD1 = 2.ITAB-FIELD2 = 5.APPEND ITAB.
    CLEAR ITAB.
    ITAB-CUSTOMER = 4.ITAB-FIELD1 = 1.ITAB-FIELD2 = 10.APPEND ITAB.
    CLEAR ITAB.
    LOOP AT ITAB.
    v_temp = itab-field1 / itab-field2.
    itab-field3 = v_temp * 100.
    modify itab.
    V_f1_sum = v_f1_sum + itab-field1.
    V_f2_sum = v_f2_sum + itab-field2.
    ENDLOOP.
    ENDFORM. " FILL_ITAB
    *& Form FILL_CAT
    text
    --> p1 text
    <-- p2 text
    FORM FILL_CAT .
    DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = 1.
    L_FIELDCAT-TABNAME = 'ITAB'.
    L_FIELDCAT-FIELDNAME = 'CUSTOMER'.
    L_FIELDCAT-REF_TABNAME = 'KNA1'.
    L_FIELDCAT-REF_FIELDNAME = 'KUNNR'.
    L_FIELDCAT-KEY = 'X'.
    APPEND L_FIELDCAT TO I_FIELDTAB.
    CLEAR L_FIELDCAT.
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = 3.
    L_FIELDCAT-TABNAME = 'ITAB'.
    L_FIELDCAT-FIELDNAME = 'FIELD1'.
    L_FIELDCAT-DO_SUM = 'X'.
    L_FIELDCAT-No_zero = 'X'.
    L_FIELDCAT-seltext_l ='VALUE1'.
    L_FIELDCAT-seltext_M ='VALUE1'.
    L_FIELDCAT-seltext_S ='VALUE1'.
    L_FIELDCAT-KEY = 'X'.
    APPEND L_FIELDCAT TO I_FIELDTAB.
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = 4.
    L_FIELDCAT-TABNAME = 'ITAB'.
    L_FIELDCAT-FIELDNAME = 'FIELD2'.
    L_FIELDCAT-DO_SUM = 'X'.
    L_FIELDCAT-No_zero = 'X'.
    L_FIELDCAT-seltext_l ='VALUE2'.
    L_FIELDCAT-seltext_M ='VALUE2'.
    L_FIELDCAT-seltext_S ='VALUE2'.
    L_FIELDCAT-KEY = 'X'.
    APPEND L_FIELDCAT TO I_FIELDTAB.
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = 5.
    L_FIELDCAT-TABNAME = 'ITAB'.
    L_FIELDCAT-FIELDNAME = 'FIELD3'.
    L_FIELDCAT-DO_SUM = 'X'.
    L_FIELDCAT-No_zero = 'X'.
    L_FIELDCAT-seltext_l ='VALUE3'.
    L_FIELDCAT-seltext_M ='VALUE3'.
    L_FIELDCAT-seltext_S ='VALUE3'.
    APPEND L_FIELDCAT TO I_FIELDTAB.
    ENDFORM. " FILL_CAT
    *& Form DISPLAY_DATA
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_DATA .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'ZALVTEST2'
    IS_LAYOUT = I_LAYOUT
    IT_FIELDCAT = I_FIELDTAB
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IT_EVENTS = I_EVENTS[]
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_DATA
    *& Form SET_SORT
    text
    --> p1 text
    <-- p2 text
    FORM SET_SORT .
    I_LAYOUT-ZEBRA = 'X'.
    DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR LS_SORT.
    LS_SORT-SPOS = 1.
    LS_SORT-FIELDNAME = 'CUSTOMER'.
    LS_SORT-TABNAME = 'ITAB'.
    LS_SORT-UP = 'X'.
    APPEND LS_SORT TO RS_SORT.
    ENDFORM. " SET_SORT
    *& Form FILL_EVENT
    text
    --> p1 text
    <-- p2 text
    FORM FILL_EVENT .
    DATA: L_I_EVENT TYPE SLIS_ALV_EVENT.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = I_EVENTS.
    READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_AFTER_LINE_OUTPUT
    INTO L_I_EVENT.
    IF SY-SUBRC = 0.
    MOVE FORMNAME_AFTER_LINE_OUTPUT TO L_I_EVENT-FORM.
    MODIFY I_EVENTS FROM L_I_EVENT INDEX SY-TABIX.
    ENDIF.
    ENDFORM. " FILL_EVENT
    *& Form AFTER_LINE_OUTPUT
    text
    FORM LINE_OUTPUT using RS_LINEINFO TYPE SLIS_LINEINFO.
    DATA: L_TABIX LIKE SY-TABIX.
    DATA: L_TABIX1 LIKE SY-TABIX.
    data: str_kunnr like struct_customer.
    check RS_LINEINFO-tabindex ne 0.
    L_TABIX = RS_LINEINFO-tabindex.
    read table itab index l_tabix.
    l_tabix1 = RS_LINEINFO-tabindex + 1.
    struct_customer-customer = itab-customer.
    read table itab into str_kunnr index l_tabix1 transporting customer.
    if sy-subrc <> 0.
    v_temp = ( v_f1_sum / v_f2_sum ) * 100.
    uline at (45).
    skip.
    uline at (45).
    write: / sy-vline , 'Total',
    12 sy-vline , (9) v_f1_sum,
    23 sy-vline , (9) v_f2_sum,
    34 sy-vline , (9) v_temp decimals 0,
    45 sy-vline.
    *uline at (46).
    endif.
    ENDFORM. " AFTER_LINE_OUTPUT
    Reward points if helpful.
    Regards.
    Srikanta Gope

  • Is the order in which a UNION ALL query returns rows guaranteed?

    Guys
    I'm doing a kind of query where I want to return matching rows in a priority order and take the first one. THink of it as getting the most specific error message for a particular context.
    SELECT * FROM (
    SELECT msg FROM errormessages WHERE device = 'x'
    UNION ALL
    SELECT msg FROM errormessages WHERE client = 'y'
    UNION ALL
    SELECT msg FROM (SELECT msg from errormessages WHERE class LIKE 'generic_' ORDER BY class)
    UNION ALL
    SELECT 'missing error message' FROM dual
    WHERE ROWNUM =1
    If UNION ALL is guaranteed to return rows in this order, great. If not, would it be better to have:
    SELECT * FROM ( SELECT * FROM(
    SELECT 1 as ord, msg FROM errormessages WHERE device = 'x'
    UNION ALL
    SELECT 2, msg FROM errormessages WHERE client = 'y'
    UNION ALL
    SELECT 4+SUBSTR(class, 7, 1), msg FROM errormessages WHERE class LIKE 'generic_'
    UNION ALL
    SELECT 9999, 'missing error message' FROM dual
    ) ORDER BY ord )
    WHERE ROWNUM =1Or, another option:
    SELECT msg FROM(
    SELECT
      CASE
        WHEN device = 'x' THEN 1
        WHEN client = 'y' THEN 2
        WHEN class LIKE 'generic_' THEN 4+SUBSTR(class, 7, 1)
      END as ord, msg
    FROM (
      SELECT * FROM errormessages WHERE device = 'x' OR  client = 'y' OR class LIKE 'generic_'
      UNION ALL
      SELECT 999, 'missing error' FROM dual
    ) ORDER BY ord
    )WHERE ROWNUM =1As you can see there is a complication in the generic; devices may advertise that they accept 1,2,3 or 4 lines of info, so I want to use the advertised capabiltiy to pick the most relevant message from the generic set if no specifics exist for the device or the client
    Which was would you go?
    Cheers
    Edited by: charred on Feb 11, 2009 4:56 AM - code tags

    charred wrote:
    So tell me guys, do I go for:
    4 queries unioned together
    or
    1 query with 4 ORs in the where clause and a case when to determine priority?It will depend on your conditions, but if you look at your explain plans you should get an idea for which is the better one; typically I would expect this to be the OR method...
    SQL> select * from emp where deptno = 20
      2  union all
      3  select * from emp where job = 'CLERK'
      4  union all
      5  select * from emp where sal > 2500;
    Execution Plan
    Plan hash value: 3153085224
    | Id  | Operation                    | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |          |    14 |   546 |     8  (75)| 00:00:01 |
    |   1 |  UNION-ALL                   |          |       |       |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID| EMP      |     5 |   195 |     2   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN          | DEPT_IDX |     5 |       |     1   (0)| 00:00:01 |
    |*  4 |   TABLE ACCESS FULL          | EMP      |     4 |   156 |     3   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS FULL          | EMP      |     5 |   195 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("DEPTNO"=20)
       4 - filter("JOB"='CLERK')
       5 - filter("SAL">2500)
    Statistics
              1  recursive calls
              0  db block gets
             18  consistent gets
              1  physical reads
              0  redo size
           1328  bytes sent via SQL*Net to client
            396  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             14  rows processed
    SQL> select * from emp
      2  where deptno = 20 or job = 'CLERK' or sal > 2500;
    Execution Plan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    10 |   390 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |    10 |   390 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DEPTNO"=20 OR "SAL">2500 OR "JOB"='CLERK')
    Statistics
              1  recursive calls
              0  db block gets
              8  consistent gets
              0  physical reads
              0  redo size
           1146  bytes sent via SQL*Net to client
            396  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              9  rows processed
    SQL>

  • Query for row by rows-before using seq number

    Hi,
    I have a table of CatalogAuthor records
    long : id
    varchar : author
    long : seqnum
    I have made the table so that initially, if there are 10000 unique authors, then the rows will have sequence numbers from 1 to 10000. As authors are dynamically added, they are given the sequence number of an existing row in the table, i.e. the nearest row whose author comes before the new author. As time goes there are more and more duplicates, and at a certain point, the table has all its sequence numbers reassigned to be monotonic increasing by author name order.
    We want to use this table to build a tree of about 10 nodes per parent, culminating in author names. So to expand the tree at the first level, we could divide 10000 by a suitable power of 10 to get the groups of sequence numbers. However, with duplicate seqnum, there may be 14365 rows so ideally, to overcome the problem of clumping, I would do some kind of query to identify the 1436 record in sorted order by sequence number, the 2872 record by seq number and so on.
    What query would that be? With appropriate indices, would it still be slow? Would I have to do 10 of these queries to expand one node with 10 children? Is there a better design to accomplish the same goal of exploding a balanced tree by author name sort order, culminating in a leaf of one particular author?
    Andy

    Hi, Andy,
    user9990110 wrote:
    Hi,
    I have a table of CatalogAuthor records
    long : id
    varchar : author
    long : seqnumYou can't be serious! The LONG data type is nothing but trouble, and completely unnecessary. You must mean NUMBER instead of LONG.
    I have made the table so that initially, if there are 10000 unique authors, then the rows will have sequence numbers from 1 to 10000. As authors are dynamically added, they are given the sequence number of an existing row in the table, i.e. the nearest row whose author comes before the new author. As time goes there are more and more duplicates, and at a certain point, the table has all its sequence numbers reassigned to be monotonic increasing by author name order.
    We want to use this table to build a tree of about 10 nodes per parent, culminating in author names. So to expand the tree at the first level, we could divide 10000 by a suitable power of 10 to get the groups of sequence numbers. However, with duplicate seqnum, there may be 14365 rows so ideally, to overcome the problem of clumping, I would do some kind of query to identify the 1436 record in sorted order by sequence number, the 2872 record by seq number and so on.
    What query would that be? With appropriate indices, would it still be slow? Would I have to do 10 of these queries to expand one node with 10 children? Is there a better design to accomplish the same goal of exploding a balanced tree by author name sort order, culminating in a leaf of one particular author?I'm just curious, why do you need this? What will this tree structure do for you that an index on author won't do?
    I don't know of any way to automatically keep a tree balanced every time DML is done.
    You could periodically re-balance the tree; that shouldn't be too hard. Let's say you want each parent to have up to r children. Use the analytic ROW_NUMBER function to assign unique numbers 0, 1, 2, 3, ... to each row, in order by author.
    The row numbered 0 will have no parent
    For all all rows numbered n (n > 0), the parent will be the row numbered FLOOR (n/r).
    Whenever you re-configure the tree, use a MERGE statatment. An index on author will probably make generating the ROW_NUMBERs faster.
    If you need help, post CREATE TABLE and INSERT statements to show the table as it exists with the tree out of balance, and also show how you want it to look after balancing. Use a small value of r (maybe 2 or 3) to keep the sample set small.
    Edited by: Frank Kulash on Jan 12, 2011 12:41 PM

  • Formula in query result rows

    Hello All,
    I have a CKF or formala (I tried both) in a query.
    There are column 1 and column 2 and column 3 is multiplication of column 1 and column 2.
    there are multiple rows and and i see correct value of column 3 for each row.
    however in the result row, i want to display column 3 as sum of all rows in column 3.
    But it is calculating by multiplying result of column 1 and result of column 2.
    Please help.
    Thanks
    Raj
    Edited by: Rajiv Gupta on Apr 16, 2009 1:52 AM

    Hello rajiv,
    you have a problem like
    a | b | a*b
    3 | 2 | 6
    4 | 5 | 20
    7 | 7 | 26 (and not 49)
    to achieve this you can use cell references ..
    what you need to do is
    1. in your query designed click on 'cells' in you 'view toolbar' .... then you can go to cells and modify it
    you can find information about it at following link
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm
    once you go to 'cells' tab ...right click on desired cell and create cell reference
    and put your formula as addition of all the values in column 3
    hope this helps
    regards,
    Swati.

  • Flashback query: Historical rows not always returned

    Hello all,
    I have a problem using flashback queries, like e.g.
    SELECT id, description, versions_starttime, versions_operation, versions_xid FROM testtable VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE
    The point is, that the historical rows are returned only for a certain period of time. Executing the above query after a certain period of time will result in returning only the current rows in the table (having versions_xxx columns returned as NULL).
    Do you have any ideas how I can fix it so I can always access the historical rows?
    Is it possible to use flashback queries to implement a complete history mechanism (including restore of rows) ?
    Many thanks in advance and best regards,
    Martin

    michaels2 wrote:
    In 11g we now have the option of total recall with this technique.But unfortunately it's not that easy with the current implementation. I wrote a blogpost some time ago about this exact topic: http://rwijk.blogspot.com/2007/11/setting-up-journaling-using-flashback.html
    Regards,
    Rob.

  • Input-Query New Rows

    Hi,
    I have created an input query, when I use this query  in the WAD, I'm able to modify key figures but I'm not able to add new rows I have a message. "No New rows or column added because not all characteristic have a key cell.
    Thanks to give me some idea.
    Eric

    Hello,
    That was a one valuable suggestion.
    I have created a Text characteristic to add a description. In my scenario I am adding in my input ready query a field to add free text for assets bought.  This works fine in BEx, but when I try to add it in WAD it is checking against master data which obviously doesn't exist, as the whole idea is to add a free text.  As you explained in your response you need to display characteristic in the rows as key and optional text (I don't see optional text for selection).  I am not sure what am I missing.
    You know how to overcome this issue?
    Regards,
    Sachin
    I am on SPS 10 BI 7.0.

Maybe you are looking for

  • Error reading product file driver files

    When attempting apply a large merge patch I receive the following error: Screening out files not valid for this installation... Determining valid on-site files... AutoPatch error: The following file is missing: /oracle/prodappl/pa/11.5.0/admin/driver

  • Bounce Management in SAP CRM 2007

    Hi Experts, we have SAP CRM 2007 and I have a few questions about Bounce Management. It is a very simple scenario, so it´s fine if only hard bounces for incoming EMails are handled. 1) Do you need ERMS for that simple form of Bounce Mgt? 2) Is the Us

  • Outgoing server works for one user not for other

    Hi, I just made a second user in Leopard. When logged in as the original user, the outgoing mail server works fine in Mail. When logged in as the new user, the outgoing mail server shows as 'offline' in Mail. In both cases the outgoing server is the

  • I tried that and I cant find anything in the app store

    I tried that and I can`t find anything in the app store

  • Selection screen variant for report

    Hi, Can we restrict the selection screen variants for reports by user? For example my report is ZREPORT. Different users can save variants for the report. When they choose a variant for executing the report, they would like to see only the variants t