DBAsupport.com Forums - Powered by vBulletin
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: ora-6510 ora-6512 ora-1403 errors

  1. #11
    Join Date
    Dec 2001
    Location
    USA
    Posts
    620
    Any advise please...
    Sam
    ------------------------
    To handle yourself, use your head. To handle others, use your heart

  2. #12
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    PHP Code:
    SQLdesc t1
     Name                     Null
    ?    Type
     
    ------------------------ -------- ----------------------------
     
    ID                                NUMBER(38)
     
    NAME                              VARCHAR2(30)

    SQLdesc t2
     Name                      Null
    ?    Type
     
    ------------------------ -------- ----------------------------
     
    ID                                 NUMBER(38)
     
    NAME                               VARCHAR2(30)

    SQLselect from t1;

            
    ID NAME
    ---------- ------------------------------
             
    1 aaaaaaa
             2 bbb
             3 ccccccccc
             4 dddddddd
             5 eeeeeee

    SQL
    select from t2 ;

            
    ID NAME
    ---------- ------------------------------
             
    1 aaaaaaa
             3 ccccccccc
             5 eeeeeee

    SQL
    get ins
      1   
    declare
      
    2   L_id number ;
      
    3   cursor c1 is
      4      select id 
    name from t1;
      
    5   begin
      6     
    for c1rec in c1 loop
      7         begin
      8           select id into L_id from t2 where id 
    c1rec.id;
      
    9         exception when no_data_found then
     10           insert into t2 values 
    (c1rec.idc1rec.name) ;
     
    11         end;
     
    12     end loop;
     
    13     commit;
     
    14     exception when others then raise ;
     
    15end;
     
    16  /

    PL/SQL procedure successfully completed.

    SQLselect from t2;

            
    ID NAME
    ---------- ------------------------------
             
    1 aaaaaaa
             3 ccccccccc
             5 eeeeeee
             2 bbb
             4 dddddddd

    SQL
    spool off 
    Is that you want?

    Tamil
    Last edited by tamilselvan; 01-07-2005 at 01:24 PM.

  3. #13
    Join Date
    Dec 2001
    Location
    USA
    Posts
    620
    Originally posted by tamilselvan
    You are the man
    Thanks a lot!
    Sam
    ------------------------
    To handle yourself, use your head. To handle others, use your heart

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