Simple SQL question

I am a former FoxPro programer who has just started working with the JDBC. I have a quick question about table focus. (I am picking up the JDBC Pocket Reference guide tomorrow so this will hopefully be my only silly question)
How can I retrieve the entire contents of a table to the result set without saying
SELECT * FROM TABLE
This seems this is a very slow alternative to just returning the entire table without going through the whole select process and returning a cursor filled with the data.
In FoxPro (ugh) you can say SELECT TABLE and that would bring the table into focus. Can you do this in Java or are you limited to an entire select statement by the JDBC driver?

I'm not a FoxPro programmer, so I don't know what the difference is between SELECT * FROM TABLE and bringing the table into focus. If it's a remote call to a database, that data's gotta come back someway. Those bytes have to cross the network sometime. I don't see the difference, but them I'm ignorant.
Are you saying that "bringing the table into focus" allows you to grab say the first ten records and then ask for the next ten when you're ready for them?
I'm not sure, but you might be talking about a scrollable ResultSet or maybe javax.sql.RowSet.
But I don't know of any way to avoid that SELECT.
Are you 100% certain that it's a problem? Have you timed the two and compared?
I have a funny feeling that FoxPro might be doing that SELECT * FROM TABLE behind the scenes and perhaps doing some nice caching to make it look fast.
Sorry I haven't been much help. Maybe someone who knows both JDBC and FoxPro will be able to answer with authority. - MOD

Similar Messages

  • Simple SQL question (I think)

    I have an SQL newbie question. I have a select query into a table (T1) that contains 2 id numbers (sender and receiver), in addition to other information. The id numbers are mapped, in a separate table (T2), to names. So, we have table T1 with data columns transactionTime (timestamp), sender id (varchar(10)), receiver id (varchar(10), and additional info in each row about transactions. Table T2 has two columns ... name (varchar(60)) and id (varchar(10)), where the id is the same as senders and receivers in the transaction table. I'd to find all transactions between a start timestamp and an end timestamp, and I would like to also display the name associated with each id.
    So, as a newbie, I tried (simplified)
    select T1.transactionTime, T1.sender, T2alias1.name, T1.receiver, T2alias2.name
    from T1, T2 as T2alias1, T2 as T2alias2
    where T1.transactionTime > timestamp('aStartTime') and T1.transactionTime < timestamp('anEndTime')
    and T1.sender = T2alias1.id and T1.receiver = T2alias2.id
    order by T1.transactionTime
    This returns some of the rows between the start and end time, but only seems to get records for a single sender, and not all of those.
    I've also tried
    where T1.transactionTime > timestamp('aStartTime') and T1.transactionTime < timestamp('anEndTime')
    and (T1.sender = T2alias1.id or T1.receiver = T2alias2.id)
    but that takes a long time to return, and returns more results then there are records in the transaction table.
    I obviously am not do this correctly. I just want to get the name associated with the ids. Any help?
    None of these look quite right to me, and none return the the data I am looking for
    ¦{Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    This query should give you correct results if, there are all assciated id's and names for both senders and recievers in table2.
    SELECT t1.transactiontime, t1.sender,t21.NAME,t1.reciever, t22.NAME
      FROM t1, t2 t21, t2 t22
    WHERE     t1.transactiontime BETWEEN timestamp(startdate) and timestamp(enddate)
           AND t1.sender = t21.ID
           AND t1.reciever = t22.ID;if either sender's ID or Recievers ID are missing in table2, the whole record will get ignored.
    You can try an outer Join get records even if the ID's are missing in table2.
    SELECT t1.transactiontime, t1.sender,t21.NAME,t1.reciever, t22.NAME
      FROM t1, t2 t21, t2 t22
    WHERE     t1.transactiontime BETWEEN timestamp(startdate) and timestamp(enddate)
           AND t1.sender = t21.ID(+)
           AND t1.reciever = t22.ID(+);if you want to know the missing ID's the add a IS NULL caluse.
    SELECT * FROM(
    SELECT t1.transactiontime, t1.sender,t21.NAME name1,t1.reciever, t22.NAME name2
      FROM t1, t2 t21, t2 t22
    WHERE     t1.transactiontime BETWEEN timestamp(startdate) and timestamp(enddate)
           AND t1.sender = t21.ID(+)
           AND t1.reciever = t22.ID(+))
      WHERE  name1 IS NULL or name2 IS NULL;G.

  • Another simple SQL question?

    Can someone help me (an SQL novice) optimize this query?
    Assume a table TRANS with four columns ACCOUNT, PURCHASE_DATE,
    ITEM_NUMBER, and QUANTITY. (Fairly self evident names, I hope.)
    I want to create a view that returns the most recent purchase
    date for each account, and the sum of all items purchase on that
    date.
    The following works, but involves a sub-query, which I think
    must be inefficient (the real table I'm working with has about
    20 million rows, returning about 1 million rows and takes
    hours!):
    select unique a.account,
    purchase_date,
    sum(quantity)
    from TRANS a,
    (select account,
    max(purchase_date) as cdate
    from TRANS
    group by account) b
    where a.account = b.account and
    a.purchase_date = b.cdate
    group by a.account;
    A second, similar query is to find the most recent purchase
    date, by account, for each item, and the total quantity of that
    item purchased on that date. But, hopefully, an answer to the
    first question will lead me in the right direction.
    Thanks!
    Bob

    Here is another batch of queries to test. The one on top is the
    only one that is drastically different from your query or
    anything that David already suggested.
    SELECT  account,
            purchase_date,
            total
    FROM    (SELECT   account,
                      purchase_date,
                      SUM (quantity) total,
                      RANK () OVER
                           (PARTITION BY account
                            ORDER BY purchase_date DESC)
                      AS rk
             FROM     trans
             GROUP BY account, purchase_date)
    WHERE    rk = 1
    ORDER BY account
    SELECT   a.account,
             a.purchase_date,
             SUM (quantity) total
    FROM     trans a,
             (SELECT   account,
                       MAX (purchase_date) cdate
              FROM     trans
              GROUP BY account) b
    WHERE    a.account = b.account
    AND      a.purchase_date = b.cdate
    GROUP BY a.account, a.purchase_date
    ORDER BY a.account
    SELECT    account,
              purchase_date,
              SUM (quantity) total
    FROM      trans a
    WHERE NOT EXISTS
              (SELECT 0
               FROM   trans b
               WHERE  b.account = a.account
               AND    b.purchase_date > a.purchase_date)
    GROUP BY  account, purchase_date
    ORDER BY  a.account
    SELECT   a.account,
             a.purchase_date,
             SUM (quantity) total
    FROM     trans a
    WHERE    a.purchase_date =
             (SELECT MAX (b.purchase_date)
              FROM   trans b
              WHERE  b.account=a.account)
    GROUP BY a.account, a.purchase_date
    ORDER BY a.account
    SELECT   a.account,
             a.purchase_date,
             SUM (quantity) total
    FROM     trans a
    WHERE    (a.account, a.purchase_date) IN
             (SELECT   b.account,
                       MAX (b.purchase_date)
              FROM     trans b
              GROUP BY b.account)
    GROUP BY a.account, a.purchase_date
    ORDER BY a.account
    SELECT   a.account,
             a.purchase_date,
             SUM (quantity) total
    FROM     trans a
    WHERE    a.purchase_date =
             (SELECT /*+ INDEX_DESC (b my_index) */
                     b.purchase_date
              FROM   trans b
              WHERE  b.account = a.account
              AND    ROWNUM = 1)
    GROUP BY a.account, a.purchase_date
    ORDER BY a.account

  • Simple SQL Question: How to reference an alias identifier in a subquery?

    SELECT (subquery, function, or expression) alias,
    (SELECT ... FROM tab2 WHERE col=alias)
    FROM tab1 WHERE ...
    How to do this in Oracle (referencing alias in a subquery)? Thanks.

    drop table tab1;
    create table tab1(col varchar2(30));
    insert into tab1 values('a');
    insert into tab1 values('b');
    insert into tab1 values('c');
    insert into tab1 values('a');
    commit;
    drop table tab2;
    create table tab2 (col varchar2(30));
    insert into tab2 values('a');
    insert into tab2 values('b');
    commit;
    SELECT t1.*,
           (SELECT col
              FROM tab2 t2
             WHERE t2.col = t1.alias) AS scalar_t2_col
      FROM (SELECT col,
                   LOWER (UPPER (col)) AS alias
              FROM tab1) t1;Or analogously...
    WITH  t1 AS (
    SELECT col,
           lower(upper(col)) AS alias
      FROM tab1)
    SELECT t1.*,
           (SELECT col
              FROM tab2  t2
             WHERE t2.col = t1.alias) AS scalar_t2_col
      FROM t1;

  • Verbose EXPLAIN PLAN output when asking for explain plan on simple SQL

    Hello. In a nutshell I have two issues: first, inability to execute EXPLAIN PLAN via SET AUTOTRACE ON EXPLAIN, and second, extremely verbose output when I log on as SYSDBA to circumvent the first issue.
    So, issue number one:
    I am trying to get an EXPLAIN PLAN via SET AUTOTRACE ON EXPLAIN for a simple SQL query:
      1   select decode(rownum,1,'JAN', 2,'FEB',3,'MAR',4,'APR',5,'MAY',6,'JUN',7,'JUL',8,'AUG',9,'SEP',10,'OCT',11,'NOV',12,'DEC')
      2* from all_objects where rownum<13
    HR@XE> /
    DEC
    JAN
    FEB
    MAR
    APR
    MAY
    JUN
    JUL
    AUG
    SEP
    OCT
    NOV
    DEC
    12 rows selected.
    HR@XE> set autotrace on explain
    HR@XE> /
    DEC
    JAN
    FEB
    MAR
    APR
    MAY
    JUN
    JUL
    AUG
    SEP
    OCT
    NOV
    DEC
    12 rows selected.
    Execution Plan
    ERROR:
    ORA-01039: insufficient privileges on underlying objects of the viewSo, first question, why am I getting this error? ALL_OBJECTS should be available to everybody, no?
    So to circumvent this I log on as sysdba and get the second issue: the following extremely verbose output
    HR@XE> connect / as sysdba
    Connected.
    SYS@XE>  select decode(rownum,1,'JAN', 2,'FEB',3,'MAR',4,'APR',5,'MAY',6,'JUN',7,'JUL',8,'AUG',9,'SEP',10,'OCT',11,'NOV',12,'DEC')
      2  from all_objects where rownum<13;
    DEC
    JAN
    FEB
    MAR
    APR
    MAY
    JUN
    JUL
    AUG
    SEP
    OCT
    NOV
    DEC
    12 rows selected.
    SYS@XE> set autotrace on explain
    SYS@XE> /
    DEC
    JAN
    FEB
    MAR
    APR
    MAY
    JUN
    JUL
    AUG
    SEP
    OCT
    NOV
    DEC
    12 rows selected.
    Execution Plan
    Plan hash value: 1291336664
    | Id  | Operation                          | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                   |                         |    12 |  3240 |     5  (20)| 00:00:01 |
    |*  1 |  COUNT STOPKEY                     |                         |       |       |            |       |
    |*  2 |   FILTER                           |                         |       |       |            |       |
    |*  3 |    HASH JOIN                       |                         |    32 |  8640 |     5  (20)| 00:00:01 |
    |   4 |     INDEX FULL SCAN                | I_USER2                 |    49 |  1078 |     1   (0)| 00:00:01 |
    |*  5 |     HASH JOIN                      |                         |    32 |  5248 |     4  (25)| 00:00:01 |
    |   6 |      INDEX FULL SCAN               | I_USER2                 |    49 |   196 |     1   (0)| 00:00:01 |
    |*  7 |      TABLE ACCESS FULL             | OBJ$                    |    33 |  2640 |     2   (0)| 00:00:01 |
    |*  8 |    TABLE ACCESS BY INDEX ROWID     | IND$                    |     1 |     8 |     2   (0)| 00:00:01 |
    |*  9 |     INDEX UNIQUE SCAN              | I_IND1                  |     1 |       |     1   (0)| 00:00:01 |
    |* 10 |    HASH JOIN                       |                         |     1 |    24 |     3  (34)| 00:00:01 |
    |* 11 |     INDEX RANGE SCAN               | I_OBJAUTH1              |     1 |    11 |     2   (0)| 00:00:01 |
    |  12 |     FIXED TABLE FULL               | X$KZSRO                 |   100 |  1300 |     0   (0)| 00:00:01 |
    |* 13 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 14 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  15 |    NESTED LOOPS                    |                         |       |       |            |       |
    |  16 |     NESTED LOOPS                   |                         |     1 |    73 |     6   (0)| 00:00:01 |
    |  17 |      NESTED LOOPS                  |                         |     1 |    63 |     4   (0)| 00:00:01 |
    |  18 |       NESTED LOOPS                 |                         |     1 |    52 |     3   (0)| 00:00:01 |
    |  19 |        MERGE JOIN CARTESIAN        |                         |     1 |    48 |     2   (0)| 00:00:01 |
    |* 20 |         INDEX RANGE SCAN           | I_OBJ5                  |     1 |    35 |     2   (0)| 00:00:01 |
    |  21 |         BUFFER SORT                |                         |   100 |  1300 |     0   (0)| 00:00:01 |
    |  22 |          FIXED TABLE FULL          | X$KZSRO                 |   100 |  1300 |     0   (0)| 00:00:01 |
    |* 23 |        INDEX RANGE SCAN            | I_USER2                 |     1 |     4 |     1   (0)| 00:00:01 |
    |* 24 |       INDEX RANGE SCAN             | I_OBJAUTH1              |     1 |    11 |     1   (0)| 00:00:01 |
    |* 25 |      INDEX RANGE SCAN              | I_DEPENDENCY1           |     4 |       |     1   (0)| 00:00:01 |
    |* 26 |     TABLE ACCESS BY INDEX ROWID    | DEPENDENCY$             |     1 |    10 |     2   (0)| 00:00:01 |
    |* 27 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 28 |    HASH JOIN                       |                         |     1 |    24 |     3  (34)| 00:00:01 |
    |* 29 |     INDEX RANGE SCAN               | I_OBJAUTH1              |     1 |    11 |     2   (0)| 00:00:01 |
    |  30 |     FIXED TABLE FULL               | X$KZSRO                 |   100 |  1300 |     0   (0)| 00:00:01 |
    |* 31 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  32 |    NESTED LOOPS                    |                         |     2 |    48 |     2   (0)| 00:00:01 |
    |* 33 |     INDEX RANGE SCAN               | I_OBJAUTH1              |     1 |    11 |     2   (0)| 00:00:01 |
    |* 34 |     FIXED TABLE FULL               | X$KZSRO                 |     2 |    26 |     0   (0)| 00:00:01 |
    |  35 |    NESTED LOOPS                    |                         |     1 |    38 |     2   (0)| 00:00:01 |
    |  36 |     NESTED LOOPS                   |                         |     1 |    25 |     2   (0)| 00:00:01 |
    |* 37 |      TABLE ACCESS BY INDEX ROWID   | TRIGGER$                |     1 |    14 |     1   (0)| 00:00:01 |
    |* 38 |       INDEX UNIQUE SCAN            | I_TRIGGER2              |     1 |       |     0   (0)| 00:00:01 |
    |* 39 |      INDEX RANGE SCAN              | I_OBJAUTH1              |     1 |    11 |     1   (0)| 00:00:01 |
    |* 40 |     FIXED TABLE FULL               | X$KZSRO                 |     1 |    13 |     0   (0)| 00:00:01 |
    |* 41 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  42 |    NESTED LOOPS                    |                         |       |       |            |       |
    |  43 |     NESTED LOOPS                   |                         |     1 |    73 |     6   (0)| 00:00:01 |
    |  44 |      NESTED LOOPS                  |                         |     1 |    63 |     4   (0)| 00:00:01 |
    |  45 |       NESTED LOOPS                 |                         |     1 |    52 |     3   (0)| 00:00:01 |
    |  46 |        MERGE JOIN CARTESIAN        |                         |     1 |    48 |     2   (0)| 00:00:01 |
    |* 47 |         INDEX RANGE SCAN           | I_OBJ5                  |     1 |    35 |     2   (0)| 00:00:01 |
    |  48 |         BUFFER SORT                |                         |   100 |  1300 |     0   (0)| 00:00:01 |
    |  49 |          FIXED TABLE FULL          | X$KZSRO                 |   100 |  1300 |     0   (0)| 00:00:01 |
    |* 50 |        INDEX RANGE SCAN            | I_USER2                 |     1 |     4 |     1   (0)| 00:00:01 |
    |* 51 |       INDEX RANGE SCAN             | I_OBJAUTH1              |     1 |    11 |     1   (0)| 00:00:01 |
    |* 52 |      INDEX RANGE SCAN              | I_DEPENDENCY1           |     4 |       |     1   (0)| 00:00:01 |
    |* 53 |     TABLE ACCESS BY INDEX ROWID    | DEPENDENCY$             |     1 |    10 |     2   (0)| 00:00:01 |
    |* 54 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 55 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 56 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  57 |    NESTED LOOPS                    |                         |     2 |    68 |     2   (0)| 00:00:01 |
    |  58 |     NESTED LOOPS                   |                         |     1 |    21 |     2   (0)| 00:00:01 |
    |  59 |      TABLE ACCESS BY INDEX ROWID   | TABPART$                |     1 |    10 |     1   (0)| 00:00:01 |
    |* 60 |       INDEX UNIQUE SCAN            | I_TABPART_OBJ$          |     1 |       |     0   (0)| 00:00:01 |
    |* 61 |      INDEX RANGE SCAN              | I_OBJAUTH1              |     1 |    11 |     1   (0)| 00:00:01 |
    |* 62 |     FIXED TABLE FULL               | X$KZSRO                 |     2 |    26 |     0   (0)| 00:00:01 |
    |* 63 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 64 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 65 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 66 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 67 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 68 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 69 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 70 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 71 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 72 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 73 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 74 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  75 |    VIEW                            |                         |     1 |    13 |     2   (0)| 00:00:01 |
    |  76 |     FAST DUAL                      |                         |     1 |       |     2   (0)| 00:00:01 |
    |* 77 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 78 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 79 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 80 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 81 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 82 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  83 |    NESTED LOOPS                    |                         |     2 |    42 |     2   (0)| 00:00:01 |
    |* 84 |     INDEX RANGE SCAN               | I_OBJAUTH1              |     1 |     8 |     2   (0)| 00:00:01 |
    |* 85 |     FIXED TABLE FULL               | X$KZSRO                 |     2 |    26 |     0   (0)| 00:00:01 |
    |* 86 |    FIXED TABLE FULL                | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  87 |    NESTED LOOPS                    |                         |     2 |    42 |     2   (0)| 00:00:01 |
    |* 88 |     INDEX RANGE SCAN               | I_OBJAUTH1              |     1 |     8 |     2   (0)| 00:00:01 |
    |* 89 |     FIXED TABLE FULL               | X$KZSRO                 |     2 |    26 |     0   (0)| 00:00:01 |
    |* 90 |      FIXED TABLE FULL              | X$KZSPR                 |     1 |    26 |     0   (0)| 00:00:01 |
    |  91 |    VIEW                            |                         |     1 |    16 |     1   (0)| 00:00:01 |
    |  92 |     SORT GROUP BY                  |                         |     1 |    86 |     1   (0)| 00:00:01 |
    |  93 |      NESTED LOOPS                  |                         |     1 |    86 |     1   (0)| 00:00:01 |
    |  94 |       MERGE JOIN CARTESIAN         |                         |     1 |    78 |     0   (0)| 00:00:01 |
    |  95 |        NESTED LOOPS                |                         |     1 |    65 |     0   (0)| 00:00:01 |
    |* 96 |         INDEX UNIQUE SCAN          | I_OLAP_CUBES$           |     1 |    13 |     0   (0)| 00:00:01 |
    |* 97 |         TABLE ACCESS BY INDEX ROWID| OLAP_DIMENSIONALITY$    |     1 |    52 |     0   (0)| 00:00:01 |
    |* 98 |          INDEX RANGE SCAN          | I_OLAP_DIMENSIONALITY$  |     1 |       |     0   (0)| 00:00:01 |
    |  99 |        BUFFER SORT                 |                         |     1 |    13 |     0   (0)| 00:00:01 |
    | 100 |         INDEX FULL SCAN            | I_OLAP_CUBE_DIMENSIONS$ |     1 |    13 |     0   (0)| 00:00:01 |
    |*101 |       INDEX RANGE SCAN             | I_OBJ1                  |     1 |     8 |     1   (0)| 00:00:01 |
    | 102 |    NESTED LOOPS                    |                         |     1 |    30 |     2   (0)| 00:00:01 |
    |*103 |     INDEX SKIP SCAN                | I_USER2                 |     1 |    20 |     1   (0)| 00:00:01 |
    |*104 |     INDEX RANGE SCAN               | I_OBJ4                  |     1 |    10 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(ROWNUM<13)
       2 - filter(("O"."TYPE#"<>1 AND "O"."TYPE#"<>10 OR "O"."TYPE#"=1 AND  (SELECT 1 FROM "SYS"."IND$"
                  "I" WHERE "I"."OBJ#"=:B1 AND ("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR
                  "I"."TYPE#"=6 OR "I"."TYPE#"=7 OR "I"."TYPE#"=9))=1) AND (("O"."SPARE3"=USERENV('SCHEMAID') OR
                  "O"."SPARE3"=1) OR "O"."TYPE#"=13 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OA",SYS."X$KZSRO"
                  "X$KZSRO" WHERE "OA"."GRANTEE#"="KZSROROL" AND "OA"."OBJ#"=:B2 AND ("OA"."PRIVILEGE#"=12 OR
                  "OA"."PRIVILEGE#"=26)) OR  EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE
                  "INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-184) OR (-"KZSPRPRV")=(-181) OR
                  (-"KZSPRPRV")=(-241)))) OR ("O"."TYPE#"=1 OR "O"."TYPE#"=2 OR "O"."TYPE#"=3 OR "O"."TYPE#"=4 OR
                  "O"."TYPE#"=5 OR "O"."TYPE#"=19 OR "O"."TYPE#"=20 OR "O"."TYPE#"=34 OR "O"."TYPE#"=35) AND  EXISTS
                  (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE "INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45)
                  OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR (-"KZSPRPRV")=(-50))) OR
                  "O"."TYPE#"=11 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OA","SYS"."DEPENDENCY$"
                  "DEP",SYS."USER$" "U",SYS."OBJ$" "O",SYS."X$KZSRO" "X$KZSRO" WHERE "O"."NAME"=:B3 AND
                  "O"."SPARE3"=:B4 AND "O"."TYPE#"=9 AND "O"."TYPE#"<>88 AND "O"."OWNER#"="U"."USER#" AND
                  "DEP"."D_OBJ#"=:B5 AND "DEP"."P_OBJ#"="O"."OBJ#" AND "OA"."OBJ#"="O"."OBJ#" AND "OA"."PRIVILEGE#"=26
                  AND "OA"."GRANTEE#"="KZSROROL") OR  EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE
                  ((-"KZSPRPRV")=(-141) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))) OR ("O"."TYPE#"=7
                  OR "O"."TYPE#"=8 OR "O"."TYPE#"=9 OR "O"."TYPE#"=28 OR "O"."TYPE#"=29 OR "O"."TYPE#"=30 OR
                  "O"."TYPE#"=56) AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OA",SYS."X$KZSRO" "X$KZSRO" WHERE
                  "OA"."GRANTEE#"="KZSROROL" AND "OA"."OBJ#"=:B6 AND ("OA"."PRIVILEGE#"=12 OR "OA"."PRIVILEGE#"=26)) OR
                   EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE "INST_ID"=USERENV('INSTANCE') AND
                  ((-"KZSPRPRV")=(-144) OR (-"KZSPRPRV")=(-141) OR (-"KZSPRPRV")=(-241)))) OR "O"."TYPE#"<>14 AND
                  "O"."TYPE#"<>28 AND "O"."TYPE#"<>29 AND "O"."TYPE#"<>30 AND "O"."TYPE#"<>56 AND "O"."TYPE#"<>93 AND
                  "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
                  "O"."TYPE#"<>13 AND  EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$" "OBJAUTH$",SYS."X$KZSRO" "X$KZSRO" WHERE
                  "GRANTEE#"="KZSROROL" AND "OBJ#"=:B7 AND ("PRIVILEGE#"=3 OR "PRIVILEGE#"=6 OR "PRIVILEGE#"=7 OR
                  "PRIVILEGE#"=9 OR "PRIVILEGE#"=10 OR "PRIVILEGE#"=11 OR "PRIVILEGE#"=12 OR "PRIVILEGE#"=16 OR
                  "PRIVILEGE#"=17 OR "PRIVILEGE#"=18)) OR "O"."TYPE#"=12 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$"
                  "OA","SYS"."TRIGGER$" "T",SYS."X$KZSRO" "X$KZSRO" WHERE "OA"."GRANTEE#"="KZSROROL" AND "T"."OBJ#"=:B8
                  AND BITAND("T"."PROPERTY",24)=0 AND "OA"."OBJ#"="T"."BASEOBJECT" AND "OA"."PRIVILEGE#"=26) OR  EXISTS
                  (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE ((-"KZSPRPRV")=(-152) OR (-"KZSPRPRV")=(-241)) AND
                  "INST_ID"=USERENV('INSTANCE'))) OR "O"."TYPE#"=14 AND ( EXISTS (SELECT 0 FROM "SYS"."OBJAUTH$"
                  "OA","SYS"."DEPENDENCY$" "DEP",SYS."USER$" "U",SYS."OBJ$" "O",SYS."X$KZSRO" "X$KZSRO" WHERE
                  "O"."NAME"=:B9 AND "O"."SPARE3"=:B10 AND "O"."TYPE#"=13 AND "O"."TYPE#"<>88 AND
                  "O"."OWNER#"="U"."USER#" AND "DEP"."D_OBJ#"=:B11 AND "DEP"."P_OBJ#"="O"."OBJ#" AND
                  "OA"."OBJ#"="O"."OBJ#" AND "OA"."PRIVILEGE#"=26 AND "OA"."GRANTEE#"="KZSROROL") OR  EXISTS (SELECT 0
                  FROM SYS."X$KZSPR" "X$KZSPR" WHERE ((-"KZSPRPRV")=(-181) OR (-"KZSPRPRV")=(-241)) AND
                  "INST_ID"=USERENV('INSTANCE'))) OR ("O"."TYPE#"=66 OR "O"."TYPE#"=100) AND  EXISTS (SELECT 0 FROM
                  SYS."X$KZSPR" "X$KZSPR" WHERE (-"KZSPRPRV")=(-265) AND "INST_ID"=USERENV('INSTANCE')) OR
                  ("O"."TYPE#"=67 OR "O"."TYPE#"=79) AND  EXISTS (SELECT 0 FROM SYS."X$KZSPR" "X$KZSPR" WHERE
                  ((-"KZSPRPRV")=(-265) OR (-"KZSPRPRV")=(-266)) AND "INST_ID"=USERENV('INSTANCE')) OR "O"."TYPE#"=19
                  AND  EXISTS (SELECT 0 FROM SYS."TABPART$" "TABPART$","SYS"."OBJAUTH$" "OBJAUTH$",SYS."X$KZSRO"
                  "X$KZSRO" WHERE "GRANTEE#"="KZSROROL" AND "BO#"="OBJ#" A)
       3 - access("O"."OWNER#"="U"."USER#")
       5 - access("O"."SPARE3"="U"."USER#")
       7 - filter("O"."NAME"<>'_NEXT_OBJECT' AND "O"."NAME"<>'_default_auditing_options_' AND
                  BITAND("O"."FLAGS",128)=0 AND "O"."LINKNAME" IS NULL)
       8 - filter("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR "I"."TYPE#"=6 OR
                  "I"."TYPE#"=7 OR "I"."TYPE#"=9)
       9 - access("I"."OBJ#"=:B1)
      10 - access("OA"."GRANTEE#"="KZSROROL")
      11 - access("OA"."OBJ#"=:B1)
           filter("OA"."PRIVILEGE#"=12 OR "OA"."PRIVILEGE#"=26)
      13 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-184) OR (-"KZSPRPRV")=(-181) OR
                  (-"KZSPRPRV")=(-241)))
      14 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR
                  (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR (-"KZSPRPRV")=(-50)))
      20 - access("O"."SPARE3"=:B1 AND "O"."NAME"=:B2 AND "O"."TYPE#"=9)
           filter("O"."TYPE#"=9 AND "O"."TYPE#"<>88)
      23 - access("O"."OWNER#"="U"."USER#")
      24 - access("OA"."OBJ#"="O"."OBJ#" AND "OA"."GRANTEE#"="KZSROROL" AND "OA"."PRIVILEGE#"=26)
           filter("OA"."PRIVILEGE#"=26 AND "OA"."GRANTEE#"="KZSROROL")
      25 - access("DEP"."D_OBJ#"=:B1)
      26 - filter("DEP"."P_OBJ#"="O"."OBJ#")
      27 - filter(((-"KZSPRPRV")=(-141) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))
      28 - access("OA"."GRANTEE#"="KZSROROL")
      29 - access("OA"."OBJ#"=:B1)
           filter("OA"."PRIVILEGE#"=12 OR "OA"."PRIVILEGE#"=26)
      31 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-144) OR (-"KZSPRPRV")=(-141) OR
                  (-"KZSPRPRV")=(-241)))
      33 - access("OBJ#"=:B1)
           filter("PRIVILEGE#"=3 OR "PRIVILEGE#"=6 OR "PRIVILEGE#"=7 OR "PRIVILEGE#"=9 OR "PRIVILEGE#"=10
                  OR "PRIVILEGE#"=11 OR "PRIVILEGE#"=12 OR "PRIVILEGE#"=16 OR "PRIVILEGE#"=17 OR "PRIVILEGE#"=18)
      34 - filter("GRANTEE#"="KZSROROL")
      37 - filter(BITAND("T"."PROPERTY",24)=0)
      38 - access("T"."OBJ#"=:B1)
      39 - access("OA"."OBJ#"="T"."BASEOBJECT" AND "OA"."PRIVILEGE#"=26)
           filter("OA"."PRIVILEGE#"=26)
      40 - filter("OA"."GRANTEE#"="KZSROROL")
      41 - filter(((-"KZSPRPRV")=(-152) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))
      47 - access("O"."SPARE3"=:B1 AND "O"."NAME"=:B2 AND "O"."TYPE#"=13)
           filter("O"."TYPE#"=13 AND "O"."TYPE#"<>88)
      50 - access("O"."OWNER#"="U"."USER#")
      51 - access("OA"."OBJ#"="O"."OBJ#" AND "OA"."GRANTEE#"="KZSROROL" AND "OA"."PRIVILEGE#"=26)
           filter("OA"."PRIVILEGE#"=26 AND "OA"."GRANTEE#"="KZSROROL")
      52 - access("DEP"."D_OBJ#"=:B1)
      53 - filter("DEP"."P_OBJ#"="O"."OBJ#")
      54 - filter(((-"KZSPRPRV")=(-181) OR (-"KZSPRPRV")=(-241)) AND "INST_ID"=USERENV('INSTANCE'))
      55 - filter((-"KZSPRPRV")=(-265) AND "INST_ID"=USERENV('INSTANCE'))
      56 - filter(((-"KZSPRPRV")=(-265) OR (-"KZSPRPRV")=(-266)) AND "INST_ID"=USERENV('INSTANCE'))
      60 - access("OBJ#"=:B1)
      61 - access("BO#"="OBJ#" AND "PRIVILEGE#"=9)
           filter("PRIVILEGE#"=9)
      62 - filter("GRANTEE#"="KZSROROL")
      63 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-189) OR (-"KZSPRPRV")=(-190) OR
                  (-"KZSPRPRV")=(-191) OR (-"KZSPRPRV")=(-192)))
      64 - filter((-"KZSPRPRV")=(-109) AND "INST_ID"=USERENV('INSTANCE'))
      65 - filter(((-"KZSPRPRV")=(-177) OR (-"KZSPRPRV")=(-178)) AND "INST_ID"=USERENV('INSTANCE'))
      66 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45) OR (-"KZSPRPRV")=(-47) OR
                  (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR (-"KZSPRPRV")=(-50)))
      67 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-205) OR (-"KZSPRPRV")=(-206) OR
                  (-"KZSPRPRV")=(-207) OR (-"KZSPRPRV")=(-208)))
      68 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-200) OR (-"KZSPRPRV")=(-201) OR
                  (-"KZSPRPRV")=(-202) OR (-"KZSPRPRV")=(-203) OR (-"KZSPRPRV")=(-204)))
      69 - filter(((-"KZSPRPRV")=(-222) OR (-"KZSPRPRV")=(-223)) AND "INST_ID"=USERENV('INSTANCE'))
      70 - filter((-"KZSPRPRV")=12 AND "INST_ID"=USERENV('INSTANCE'))
      71 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-251) OR (-"KZSPRPRV")=(-252) OR
                  (-"KZSPRPRV")=(-253) OR (-"KZSPRPRV")=(-254)))
      72 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-258) OR (-"KZSPRPRV")=(-259) OR
                  (-"KZSPRPRV")=(-260) OR (-"KZSPRPRV")=(-261)))
      73 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-246) OR (-"KZSPRPRV")=(-247) OR
                  (-"KZSPRPRV")=(-248) OR (-"KZSPRPRV")=(-249)))
      74 - filter(((-"KZSPRPRV")=(-268) OR (-"KZSPRPRV")=(-267)) AND "INST_ID"=USERENV('INSTANCE'))
      77 - filter(((-"KZSPRPRV")=(-277) OR (-"KZSPRPRV")=(-278)) AND "INST_ID"=USERENV('INSTANCE'))
      78 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-292) OR (-"KZSPRPRV")=(-293) OR
                  (-"KZSPRPRV")=(-294)))
      79 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-282) OR (-"KZSPRPRV")=(-283) OR
                  (-"KZSPRPRV")=(-284) OR (-"KZSPRPRV")=(-285)))
      80 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-302) OR (-"KZSPRPRV")=(-303) OR
                  (-"KZSPRPRV")=(-304) OR (-"KZSPRPRV")=(-305) OR (-"KZSPRPRV")=(-306) OR (-"KZSPRPRV")=(-307)))
      81 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-315) OR (-"KZSPRPRV")=(-316) OR
                  (-"KZSPRPRV")=(-317) OR (-"KZSPRPRV")=(-318)))
      82 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-320) OR (-"KZSPRPRV")=(-321) OR
                  (-"KZSPRPRV")=(-322)))
      84 - access("OBJ#"=:B1)
      85 - filter("GRANTEE#"="KZSROROL")
      86 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-309) OR (-"KZSPRPRV")=(-310) OR
                  (-"KZSPRPRV")=(-311) OR (-"KZSPRPRV")=(-312) OR (-"KZSPRPRV")=(-313)))
      88 - access("OBJ#"=:B1)
      89 - filter("GRANTEE#"="KZSROROL")
      90 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-302) OR (-"KZSPRPRV")=(-303) OR
                  (-"KZSPRPRV")=(-304) OR (-"KZSPRPRV")=(-305) OR (-"KZSPRPRV")=(-306) OR (-"KZSPRPRV")=(-307)))
      96 - access("C"."OBJ#"=:B1)
      97 - filter("DIML"."DIMENSION_TYPE"=11)
      98 - access("DIML"."DIMENSIONED_OBJECT_ID"=:B1 AND "DIML"."DIMENSIONED_OBJECT_TYPE"=1)
    101 - access("DIML"."DIMENSION_ID"="DO"."OBJ#")
           filter("DO"."OBJ#"="DIM"."OBJ#")
    103 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
           filter("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
    104 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
    SYS@XE>Many thanks in advance.
    Jason

    Welcome to the forum!
    Whenever you post please provide your 4 digit Oracle Version (result of SELECT * FROM V$VERSION).
    >
    So, first question, why am I getting this error? ALL_OBJECTS should be available to everybody, no?
    >
    Your user probably does have access to ALL_OBJECTS. But you need to have dba privileges to access views base objects.
    The "ORA-01039: insufficient privileges on underlying objects of the view" message is telling you that the user does not have privileges to access the BASE OBJECTS that used to build the view. Access to those base objects is necessary to generate the plan you are trying to see.
    So to circumvent this I log on as sysdba and get the second issue: the following extremely verbose output
    >
    And that is because sysdba DOES have access to the base objects of the view. You asked for a plan and you got it. That verbose output IS the plan and all of those oddly named tables are being accessed to satisfy your query so are included in the plan.
    Do your query using DUAL or the SCOTT.EMP table and you won't get the error.

  • Urgent SQL question : how to flip vertical row values to horizontal ?

    Hello, Oracle people !
    I have an urgent SQL question : (simple for you)
    using SELECT statement, how to convert vertical row values to horizontal ?
    For example :
    (Given result-set)
    MANAGER COLUMN1 COLUMN2 COLUMN3
    K. Smith ......1
    K. Smith ...............1
    K. Smith ........................1
    (Needed result-set)
    MANAGER COLUMN1 COLUMN2 COLUMN3
    K. Smith ......1 .......1 .......1
    I know you can, just don't remeber how and can't find exactly answer I'm looking for. Probably using some analytic SQL function (CAST OVER, PARTITION BY, etc.)
    Please Help !!!
    Thanx !
    Steve.

    scott@ORA92> column vice_president format a30
    scott@ORA92> SELECT f.VICE_PRESIDENT, A.DAYS_5, B.DAYS_10, C.DAYS_20, D.DAYS_30, E.DAYS_40
      2  FROM   (select t2.*,
      3                row_number () over
      4                  (partition by vice_president
      5                   order by days_5, days_10, days_20, days_30, days_40) rn
      6            from   t2) f,
      7           (SELECT T2.*,
      8                row_number () over (partition by vice_president order by days_5) RN
      9            FROM   T2 WHERE DAYS_5 IS NOT NULL) A,
    10           (SELECT T2.*,
    11                row_number () over (partition by vice_president order by days_10) RN
    12            FROM   T2 WHERE DAYS_10 IS NOT NULL) B,
    13           (SELECT T2.*,
    14                row_number () over (partition by vice_president order by days_20) RN
    15            FROM   T2 WHERE DAYS_20 IS NOT NULL) C,
    16           (SELECT T2.*,
    17                row_number () over (partition by vice_president order by days_30) RN
    18            FROM   T2 WHERE DAYS_30 IS NOT NULL) D,
    19           (SELECT T2.*,
    20                row_number () over (partition by vice_president order by days_40) RN
    21            FROM   T2 WHERE DAYS_40 IS NOT NULL) E
    22  WHERE  f.VICE_PRESIDENT = A.VICE_PRESIDENT (+)
    23  AND    f.VICE_PRESIDENT = B.VICE_PRESIDENT (+)
    24  AND    f.VICE_PRESIDENT = C.VICE_PRESIDENT (+)
    25  AND    f.VICE_PRESIDENT = D.VICE_PRESIDENT (+)
    26  AND    f.VICE_PRESIDENT = E.VICE_PRESIDENT (+)
    27  AND    f.RN = A.RN (+)
    28  AND    f.RN = B.RN (+)
    29  AND    f.RN = C.RN (+)
    30  AND    f.RN = D.RN (+)
    31  AND    f.RN = E.RN (+)
    32  and    (a.days_5 is not null
    33            or b.days_10 is not null
    34            or c.days_20 is not null
    35            or d.days_30 is not null
    36            or e.days_40 is not null)
    37  /
    VICE_PRESIDENT                     DAYS_5    DAYS_10    DAYS_20    DAYS_30    DAYS_40
    Fedele Mark                                                          35473      35209
    Fedele Mark                                                          35479      35258
    Schultz Christine                              35700
    South John                                                                      35253
    Stack Kevin                                    35701      35604      35402      35115
    Stack Kevin                                    35705      35635      35415      35156
    Stack Kevin                                    35706      35642      35472      35295
    Stack Kevin                                    35707      35666      35477
    Stack Kevin                                               35667      35480
    Stack Kevin                                               35686
    Unknown                             35817      35698      35596      35363      35006
    Unknown                                        35702      35597      35365      35149
    Unknown                                        35724      35599      35370      35155
    Unknown                                                   35600      35413      35344
    Unknown                                                   35601      35451      35345
    Unknown                                                   35602      35467
    Unknown                                                   35603      35468
    Unknown                                                   35607      35475
    Unknown                                                   35643      35508
    Unknown                                                   35644
    Unknown                                                   35669
    Unknown                                                   35684
    Walmsley Brian                                 35725      35598
    23 rows selected.

  • Can anyone tell me what is wrong with the simple sql?

    Hi,
    I have a simple SQL (see attached). It returns records when it does not include the Order By sorting clause. However, if it includes the Order By clause, Oracle says no data found. Anyone can give me some ideas what could cause the problem?
    Thanks in advance.
    SELECT ih.item_key, e.episode_key, e.episode_date, wp.work_package_key, p.patient_name, c.codes_key
    FROM work_package wp, episodes e, item_header ih, patients p, codes c, station_element se, station_data sd
    WHERE wp.work_item_key = e.episode_key
    and e.episode_key = ih.item_key
    and ih.logical_parent_key = p.patient_key
    and e.episode_type = c.code_value
    and wp.asgn_station_key = se.item_key
    and se.station_name like 'DICT FIX%'
    and sd.station_key = wp.asgn_station_key
    and (sd.facility = '0' or sd.facility = 1)
    and wp.on_hold <> 'Y' and c.code_type = 'CEPT'
    and c.setup_group = 1
    ORDER BY e.episode_date, e.medrec_no;

    Hmmm...can you post a SQL Plus session that demonstrates this?

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • 4 Simple Flash Questions that Are Stumping Me!

    What is the Frame Rate for Web Animations
    Q1. I am making an animation which will be played on the web. What is the default frame rate (fps) of Flash CS5? And what is the frame rate of for web?
    Q2. My animation needs to be 30 seconds long. So at 15 fps that would mean I need to use 600 frames in Flash?
    How Do I Mask everything so all I see is the Content on the Stage?
    I have a wide image that extends past my movies stage size so when I preview my movie the image is visible. How do I mask out anything that extends past my movies window size? I believe I can create a layer named "mask" and place it above all other layers, but I forget how to make the mask. Any help is appreciated.
    How to Fade a Graphic
    I have a graphic element (some type) and I want it to fade from 0% to 100%. In older versions of Flash I could just select the symbol and then set it's alpha value to 0%, move a few keyframes and then set the alpha to 100%. Voila! but now it doesn't seem to work that way. How can I do this in CS5?

    Ned, it says 24 fps which means there is 24 frames per second so each 24 frames is 1 second.
    Date: Fri, 4 Nov 2011 05:35:16 -0600
    From: [email protected]
    To: [email protected]
    Subject: 4 Simple Flash Questions that Are Stumping Me!
        Re: 4 Simple Flash Questions that Are Stumping Me!
        created by Ned Murphy in Flash Pro - General - View the full discussion
    1 You can create your character as a movieclip and copy/paste that movieclip from one file to another. 2. One way to create a movieclip is to copy all the frame of the animation's timeline (select them all, right click the selection, choose Copy Frames), then create a new movieclip symbol (Insert -> New Symbol...etc) right click on its only keyframe and chhose Paste Frames.  THat will put all the layers and frames you copied into the movieclip The only way to come close to being certain about the timing of you animation is to use code to keep track of the time, something like getTimer()..  The frame rate that a file plays at is not a reliable means of dictating the time it takes due to a variety of factors which include the amount of content you are trying to process and performance limits of the user's machine.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4007420#4007420
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4007420#4007420. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Flash Pro - General by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Stored Procedures for Simple SQL statements

    Hi Guys,
    We are using Oracle 10g database and Web logic for frontend.
    The Product is previously developed in DotNet and SQL Server and now its going to develop into Java (Web Logic) and Oracle 10g database.
    Since the project is developed in SQL Server, there are lot many procedures written for simple sql queries. Now I would like to gather your suggestions / pointers on using procedures for simple select statements or Inserts from Java.
    I have gathered some list for using PL/SQL procedure for simple select queries like
    Cons
    If we use procedures for select statements there are lot many Ref Cursors opened for Simple select statements (Open cursors at huge rate)
    Simple select statements are much faster than executing them from Procedure
    Pros
    Code changes for modifying select query in PL/SQL much easier than in Java
    Your help in this regard is more valuable. Please post your points / thoughts here.
    Thanks & Regards
    Srinivas
    Edited by: Srinivas_Reddy on Dec 1, 2009 4:52 PM

    Srinivas_Reddy wrote:
    Cons
    If we use procedures for select statements there are lot many Ref Cursors opened for Simple select statements (Open cursors at huge rate)No entirely correct. All SQLs that hit the SQL engine are stored as cursors.
    On the client side, you have an interface that deals with this SQL cursor. It can be a Java class, a Delphi dataset, or a PL/SQL refcursor.
    Yes, cursors are created/opened at a huge rate by the SQL engine. But is is capable of doing that. What you need to do to facilitate that is send it SQLs that uses bind variables. This enables the SQL engine to simply re-use the existing cursor for that SQL.
    Simple select statements are much faster than executing them from ProcedureAlso not really correct. SQL performance is SQL performance. It has nothing to do with how you create the SQL on the client side and what client interface you use. The SQL engine does not care whether you use a PL/SQL ref cursor or a Java class as your client interface. That does not change the SQL engine's performance.
    Yes, this can change the performance on the client side. But that is entirely in the hands of the developer and how the developer selected to use the available client interfaces to interface with the SQL cursor in the SQL engine.
    Pros
    Code changes for modifying select query in PL/SQL much easier than in JavaThis is not a pro merely for ref cursors, but using PL/SQL as the abstraction layer for the data model implemented, and having it provide a "business function" interface to clients, instead of having the clients dealing with the complexities of the data model and SQL.
    I would seriously consider ref cursors in your environment. With PL/SQL servicing as the interface, there is a single place to tune SQL, and a single place to update SQL. It allows one to make data model changes without changing or even recompiling the client. It allows one to add new business logical and processing rules, again without having to touch the client.

  • SQL Question Bank and Answers for Practise

    Dear Readers:
    Does any one have any recommendation on SQL question bank and answers where I could practice my SQL.
    I have developed some basic knowledge of SQL thanks to the MS community, but I am looking for some additional Questions or textbook  recommendations which has questions and answers to queries for practice.
    Best Wishes,
    SQL75

    Hi,
    Refer below post.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/446b2247-5124-49c1-90c9-b7fea0aa4f83/sql-dba-books?forum=sqlgetstarted
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • Sql question : TRUNCATE vs Delete

    hi
    this is sql question, i don't know where i should post it, so here it is.
    i just want to know the best usage of each. both commands delete records in a table, one deletes all, and the other can do the same plus option to delete specified records. if i just want to purge the table. which one is better and why? thanks

    this is crucial to my design, i need to be able to
    rollback if one of the process in the transaction
    failed, the whole transaction should rollback. if
    truncate does not give me this capability, then i have
    to consider Delete.From the Oracle manual (sans the pretty formatting):
    TRUNCATE
    Caution: You cannot roll back a TRUNCATE statement.
    Purpose
    Use the TRUNCATE statement to remove all rows from a table or cluster. By default,
    Oracle also deallocates all space used by the removed rows except that specified by
    the MINEXTENTS storage parameter and sets the NEXT storage parameter to the size
    of the last extent removed from the segment by the truncation process.
    Removing rows with the TRUNCATE statement can be more efficient than dropping
    and re-creating a table. Dropping and re-creating a table invalidates the table?s
    dependent objects, requires you to regrant object privileges on the table, and
    requires you to re-create the table?s indexes, integrity constraints, and triggers and
    respecify its storage parameters. Truncating has none of these effects.
    See Also:
    DELETE on page 16-55 and DROP TABLE on page 17-6 for
    information on other ways to drop table data from the database
    DROP CLUSTER on page 16-67 for information on dropping
    cluster tables
    Prerequisites
    To truncate a table or cluster, the table or cluster must be in your schema or you
    must have DROP ANY TABLE system privilege.

  • Simple performance question

    Simple performance question. the simplest way possible, assume
    I have a int[][][][][] matrix, and a boolean add. The array is several dimensions long.
    When add is true, I must add a constant value to each element in the array.
    When add is false, I must subtract a constant value to each element in the array.
    Assume this is very hot code, i.e. it is called very often. How expensive is the condition checking? I present the two scenarios.
    private void process(){
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             if (add)
             matrix[i][ii][iii][...]  += constant;
             else
             matrix[i][ii][iii][...]  -= constant;
    private void process(){
      if (add)
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             matrix[i][ii][iii][...]  += constant;
    else
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
           matrix[i][ii][iii][...]  -= constant;
    }Is the second scenario worth a significant performance boost? Without understanding how the compilers generates executable code, it seems that in the first case, n^d conditions are checked, whereas in the second, only 1. It is however, less elegant, but I am willing to do it for a significant improvement.

    erjoalgo wrote:
    I guess my real question is, will the compiler optimize the condition check out when it realizes the boolean value will not change through these iterations, and if it does not, is it worth doing that micro optimization?Almost certainly not; the main reason being that
    matrix[i][ii][iii][...]  +/-= constantis liable to take many times longer than the condition check, and you can't avoid it. That said, Mel's suggestion is probably the best.
    but I will follow amickr advice and not worry about it.Good idea. Saves you getting flamed with all the quotes about premature optimization.
    Winston

  • Simple SQL Query and Parameters and LOV

    Newbie and trying to work thru building a simple sql query with a single table query and use a parameter and lov.
    Can anyone point me to an example.
    simple query:
    select cust_id, name_desc, name_add1, name_add2, name_city
    from customer_table
    where cust_id = :cust_parm
    This works in straight sql and in the query builder by prompting for the customer ID. When building a parameter using LOV or search, it doesn't seem to detect the variable.
    Thanks..
    DD

    If you are using version 11g, then as soon as you save the query in the data model, it should notice the parameter and ask if you want to add the parameter to the data model. What version of BIP are you using?
    What happens if you exclude the parameter from the query and simply hard-code the criteria? Can you generate XML data?
    From your wording, it sounds like you're trying to create a parameter from the LOV dialog. LOVs and parameters are totally distinct. After each are created separately, then you configure the parameter to use the LOV.

  • Simple SQL query statement is needed

    I need a simple SQL query to fetch records which is existed in all the departments.
    for example: i want to list the employees which are existed in each and every department.. not sure how should i get those.. will anyone help me please.. thanks in advance

    I think it would be wise to go to the following training:
    Oracle Database <version> : Introduction to SQL
    You will get the information you are looking for in five days. You can go find a tutorial on ANSI SQL, as advised by this board for free, to fix your immediate problem with a simple query. But, I personally recommend a more formal class specific to Oracle, as you will also get information about PL/SQL, and you get the benefit with working with other DBA/programmers when you are learning. This will solve your immediate issue, and any future issues with the language.
    You can find it in the Education section of the Oracle website.

Maybe you are looking for

  • Bootcamp, A2DP using Vista on Macbook Air ( How To )

    Hi, Thought I help those out who've recently picked up a Macbook Air and get them running on Bluetooth/Windows. People complain about the 1 USB, but who cares, the only thing I've got in the USB (when needed) is the Superdrive and everything else run

  • HP ENVY 15t Quad TouchSmart Battrie stop charging bafter runing HP update.

    My batterie was charging fine till yesterday,  but after running an hp update it totely stop charging and is staying at 0%, before yesterday I was getting 4 to 6 hour life on it. I think thgis is my last HP I buy I won over 10 HP computer the past fe

  • Changing the background box color of mail form

    Well I have this code, that maybe is faulty but is working and I want to know if is possible to change the background color of the three first boxes (Nombre, name, email). The problem is if you open it with Coda or similar that the background color o

  • Mac don't use the dedicated gfx card

       Hi i have a late 2011 macbook pro 15 with i7 and hd6750gfx card. but i installed osx again and installed every uppdate and so on. But when i play Starcraft 2 i lagg alot. i look at my speccs and the mac says i only have the hd3000 integrated gfx c

  • Can't find channel lineup for Motorola DCT700 Set top Adapter

    I have two DVRs and a Motorola DCT7000 Digital Set Top Adapter in my house.  I can use Verizon's web site as well as the on-screen menus to find the channel lineups for the DVRs, but the channels on the Digital Set Top Adapter (little grey box) do no