Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: vc123
  • Order by date
  1. vc123

    help with query

    select ejheeid, ejhhourlypayrate, ejhannsalary from emphJob t1 where ejhjobeffdate=(select max(ejhjobeffdate) from emphJob where ejheeid=t1.ejheeid) VC
  2. vc123

    Copying tables from one user to another

    'SCOTT' has to grant the 'select' privilege on the 'bonus' table to 'STUDENT': grant select on bonus to student; VC
  3. vc123

    PL/SQL simple question, thanks in advance

    Please post an example proving your point. Always eager to learn ... VC
  4. vc123

    PL/SQL simple question, thanks in advance

    Sorry, Engi, it's one of those Oracle myths. count(rowid) or count(1) is no faster than count(*) VC
  5. vc123

    PL/SQL simple question, thanks in advance

    I think he was trying to read 50001 _at most_ in order to avoid reading, say, a million rows. He mentioned that this trick would work if one wanted to make sure that the table contains _at least_ 50000 rows. Rgds.
  6. vc123

    PL/SQL simple question, thanks in advance

    SantaMufasa , He probably meant: select count(*) into V_COUNT from MYTABLE where ...your criteria and rownum <= 50001; VC.
  7. vc123

    PL/SQL simple question, thanks in advance

    SantaMufasa, Yes, you're absolutely right -- if the original poster _must_ know the number of rows beforehand, then he's got to run the 'count(*)' query. There is no other way except improving the count(*) query (indexes and such). VC
  8. vc123

    PL/SQL simple question, thanks in advance

    zihancool, What's the real reason for knowing how many rows a resultset contains ? SantaMufasa, It's impossible in Oracle (as in SQL Server or DB2) to 'know' how many rows a table contains without running an actual query which can prove to be quite costly and should be avoided if possible...
  9. vc123

    Looping through elements of a record in PL/SQL

    Sorry, no offence meant -- just wanted to answer the specific question. My apologies and all that... Rgds.
  10. vc123

    Looping through elements of a record in PL/SQL

    Well, I am sorry to say but you are wrong: 1. His specific question was whether he can iterate over the record fields (as he showed in his pseudo-code). The answer to this question is NO, Orace does not offer any syntax, in PL/SQL, to loop over a record's fields. 2. Now , if he wants to...
  11. vc123

    Looping through elements of a record in PL/SQL

    No, it cannot be done. You can access record fields only by name. Rgds.
  12. vc123

    How to delete a million rows and commit every 1000 rows?

    If you want to delete so many rows, it may be more efficient to create a new table with the rows you want to preserve in the nologging mode: create table t2 nologging as select * from t1 where <rows you want keep>; drop table t1; rename t2 to t1; Rgds.
  13. vc123

    REF CURSOR

    DBMS_SQL is the only way to handle a result set with an unknown number and type of columns in PLSQL. You cannot parse a ref cursor in PL/SQL (although you can in Java, VB, etc.) Rgds.
  14. vc123

    NOT IN &amp; NULL problem

    Hello, Given: t1: X - null null null null 1 2 3 4 5 t2: X - 3 4 If you execute 'select * from t1 where x not in (select x from t2);', you will lose all the null values from t1 (as you already know). It's not because of Oracle indexes not storing nulls, but the reason is that the...
  15. vc123

    MS/SQL to PL/SQL

    Hello, You can do this so: select trunc(sysdate-10, 'd')-1 from dual; E.g.: select x, trunc(x-10, 'd')-1 from ( select to_date('12/2/03', 'mm/dd/yy') + rownum x from user_objects where rownum<=14); X TRUNC(X-10,'D')-1 12/3/2003 11/22/2003 12/4/2003 11/22/2003 12/5/2003 11/22/2003...

Part and Inventory Search

Back
Top