SQL Oracle error


 
Thread Tools Search this Thread
Top Forums Programming SQL Oracle error
# 1  
Old 07-04-2011
SQL Oracle error

Am trying to run this :
Code:
DECLARE
   CURSOR c1
   IS
      SELECT customer_id, num3
        FROM table1
       WHERE text1 = 'pp' AND customer_id IS NOT NULL;

   custcount        INTEGER;
   oldtext24        VARCHAR2 (80);
   commit_counter   INTEGER       := 0;
BEGIN
   FOR i IN c1
   LOOP
      SELECT COUNT (*)
        INTO custcount
        FROM table2
       WHERE customer_id = i.customer_id;

      IF custcount = 0
      THEN
         INSERT INTO table2
                     (customer_id, text24
                     )
              VALUES (i.customer_id, i.num3
                     );

         UPDATE table1
            SET text2 = 'not_found'
          WHERE text1 = 'proserv';
      ELSE
         SELECT text24
           INTO oldtext24
           FROM info_cust_text
          WHERE customer_id = i.customer_id;

         UPDATE table2
            SET text24 = i.num3
          WHERE customer_id = i.customer_id;

         UPDATE table1
            SET text2 = oldtext24
          WHERE text1 = 'ppp';
      END IF;

      commit_counter := commit_counter + 1;

      IF (commit_counter = 500)
      THEN
         commit_counter := 0;
         COMMIT;
      END IF;
   END LOOP;
END;


but i get this error:
Code:
ERROR at line 1:
ORA-01555: snapshot too old: rollback segment number 14 with name "_SYSSMU14$"
too small
ORA-06512: at line 12


any idea?

Last edited by pludi; 07-04-2011 at 03:50 AM..
# 2  
Old 07-04-2011
Try to pass it at a time the machine has less activity or ask you Oracle DBA to increase the undo retention of your undo tablespace (if necessary, ask your dba to make sure the space available at Operating system level is sufficient for the undo tablespace to extend, so that it is able to handle the task you are willing to process)
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Identify tables from Oracle sql scripts

Hi, Please let me know if you have any thoughts on how to read a table that has all the oracle sql files or shell scripts at the job and step level to identify all the tables that does merge, update, delete, insert, create, truncate, alter table (ALTER TABLE XYZ RENAME TO ABC) and call them out... (1 Reply)
Discussion started by: techmoris
1 Replies

2. Shell Programming and Scripting

Capturing Oracle SQL Error Codes

My issue pertains to earlier posts like exit unix script after sqlerror in procedure - dBforums SQLPLUS Error Capturing | Unix Linux Forums | Shell Programming and Scripting We are executing PL/SQL blocks from shell scripts using SQLPLUS. The error code has to be captured into a logfile that... (3 Replies)
Discussion started by: jerome_rajan
3 Replies

3. Shell Programming and Scripting

Shell script with Oracle PL/SQL

Hi Gurus, I am new to this unix world...I need your help to walk through. I want to learn shell scripting..... The shell script which can be able to use with oracle pl/sql... So please suggest me which shell is good. Which Unix/Linux version is good for this to Install to get practice the... (8 Replies)
Discussion started by: GaneshAnanth
8 Replies

4. Programming

pass value from Oracle sql to Korn shell

Hi All , I am trying to pass a value from sqlplus to korn shell . There is a table tab1 in Oracle that has a column userdate. I need to pass the userdate to the korn shell . This is what I am doing . VALUE=`sqlplus -silent username/password << END set pagesize 0 feedback off verify off... (14 Replies)
Discussion started by: megha2525
14 Replies

5. Shell Programming and Scripting

perl- oracle sql query

Hi, I am new to perl.How to query oracle database with perl??? Thanks (1 Reply)
Discussion started by: tdev457
1 Replies

6. Shell Programming and Scripting

Running Oracle SQL from shell script

Hi, can anyone help me with this script please. I need the oracle command to go into the unix batch file. #!/bin/sh # A menu driven Shell script which has following options # for acmtoron@> # # # Exit # As per option do the job #---- while : do clear echo " A C M LOG MONITORING... (0 Replies)
Discussion started by: tinaaguilera
0 Replies

7. Shell Programming and Scripting

Read value from user and use it in Oracle SQL query

Guys can anyone just tell me whether i can pass a value(from UNIX SCRIPT) as an ARGUMENT in Oracle Query? e.g. echo "enter value" read value insert into tablename where col=$value /*something like this*/ (1 Reply)
Discussion started by: subodh.thakar
1 Replies

8. Shell Programming and Scripting

Oracle SQL Query & connect?

Hi I'm looking to query a table on a database and then iterate over the results in a loop. I believe this is the last part of my script that I need (after finding out threads for passing variables to other scripts and calling functions in other scripts). I've searched the forums but the best... (8 Replies)
Discussion started by: Dird
8 Replies

9. Shell Programming and Scripting

How to capture value in shell variable from oracle sql?

Hi Friends, Do someone know how to capture value in a shell variable from oracle sql? Requirement : In a table we want to count the number of records and want to pass this value to a shell variable where it can be manipulated later. In ksh shell we open oracle connection from sqlplus. For... (1 Reply)
Discussion started by: sourabhsharma
1 Replies
Login or Register to Ask a Question