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

Thread: for loop??

  1. #1
    Join Date
    Oct 2000
    Posts
    144
    I have a script that has a loop up 120,000 times of inserting data. For some reason,
    it input up to 99,000 and gives me error. How can I fix it?
    ERROR at line 1:
    ORA-01401: inserted value too large for column
    ORA-06512: at line 8

    for i IN 1..120,000 LOOP
    INSERT statement....

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Your target column is not large enough.
    Jeff Hunter

  3. #3
    Join Date
    Oct 2000
    Posts
    144
    the empno can hold up to 10 digits. I cannot undestand why it does not accept
    after 99,000 input.

    SQL> desc employee
    Name Null? Type
    --------------------------------------- ---------- -------- -----------------
    EMPNO NOT NULL NUMBER(10)
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)

    FOR i IN 1..120000 LOOP
    INSERT INTO a.employee
    VALUES (i, 'ADAMS' || to_char(i), 'CLERK', 7788, sysdate, 1100, NULL,
    20);

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by Trina
    the empno can hold up to 10 digits. I cannot undestand why it does not accept
    after 99,000 input.

    SQL> desc employee
    Name Null? Type
    --------------------------------------- ---------- -------- -----------------
    EMPNO NOT NULL NUMBER(10)
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)

    FOR i IN 1..120000 LOOP
    INSERT INTO a.employee
    VALUES (i, 'ADAMS' || to_char(i), 'CLERK', 7788, sysdate, 1100, NULL,
    20);
    Your problem is with the ENAME column. 'ADAMS100000' is bigger than 10 chars.
    Jeff Hunter

  5. #5
    Join Date
    Oct 2000
    Posts
    144
    thank you Jeff. I keep looking at empno.

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