DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Ora-01410: Invalid Rowid

  1. #1
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681

    Ora-01410: Invalid Rowid

    Hi Friends,

    I've created a view of two tables, and I included rowid because I am fetching
    its uniqueness thru it. For example:
    Tables:
    1. LOANS_A (NAME, AMOUNT)
    2. LOANS_B (NAME, AMOUNT)

    CREATE VIEW LOANS AS SELECT ROWID as R1,NAME,AMOUNT FROM LOANS_A
    UNION ALL SELECT ROWID as R1,NAME,AMOUNT FROM LOANS_B;

    sql> SELECT R1 FROM LOANS;

    R1
    ---

    AAAAAbbbbbbdddd1ee


    sql> select * from loans where r1='AAAAAbbbbbbdddd1ee';

    ORA-01410: Invalid Rowid


    How do I avoid this error pls....


    Thanks a lot
    Behind The Success And Failure Of A Man Is A Woman

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you cant query rowid's like that, you shoukdnt really be using rowid at all, use your own primary key

  3. #3
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681
    thanks davey
    sad :( ... this table dont have PK and its partitioned one and got 100+million rows.

    Is this the right wat to do the primary key?:

    alter table loans_a add(pk_1 number);
    alter table loans_b add(pk_2 number);

    update loans_a set pk_1=rownum;
    update loans_b set pk_2=rownum;

    alter table loans_a add primary key (pk_1);
    alter table loans_b add primary key (pk_2);

    Thanks
    Last edited by yxez; 09-03-2007 at 07:25 PM.
    Behind The Success And Failure Of A Man Is A Woman

  4. #4
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    Whats the table partitioned on ?

    You should understand the underlying data model before deciding on the primary key

    You can always use a rownum or a sequence to generate the primary key

    regards
    Hrishy
    Last edited by hrishy; 09-04-2007 at 08:17 AM.

  5. #5
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by yxez
    ... this table dont have PK and its partitioned one and got 100+million rows.
    To find your PK candidate ask yourself "how do I know there are no duplicate rows in this table?"
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width