Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: question about insert operation

Re: question about insert operation

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 25 Dec 2002 13:13:21 -0800
Message-ID: <92eeeff0.0212251313.56cf8ddf@posting.google.com>


DA Morgan <damorgan_at_exesolutions.com> wrote in message news:<3E093C85.8C77729E_at_exesolutions.com>...
> music4 wrote:
>
> > Greetings,
> >
> > I'am writing a program that keeps receiving data from other process and
> > insert the data into a db table. Now I'm think this question: is there any
> > case that "INSERT" operation fail, but next try will success? (you can
> > ingore software bug case)
> >
> > The case I can figure out are:
> > 1) Session exceed maximun limit
> > 2) Table space is full
> >
> > Any others? Please help!
> >
> > Thanks in advance!
> > evan

To add to Daniel's post.

Assuming you are using PLSQL code to do your inserts then you can also use PLSQL exception handling to capture an error. e.g.

SET SERVEROUT ON
DECLARE
   ......
   error_no_ NUMBER;
   error_msg_ VARCHAR2(100);
BEGIN
    INSERT INTO ......
    .......
    EXCEPTION

       WHEN OTHERS THEN
          error_no_ := SQLCODE;
          error_msg_ := SUBSTR(SQLERRM(error_no_), 1, 100);
          DBMS_OUTPUT.PUT_LINE('Error No: ' || TO_CHAR(error_no_));
          DBMS_OUTPUT.PUT_LINE('Error Msg: ' || error_msg_);
END;
/

Regards
/Rauf Sarwar Received on Wed Dec 25 2002 - 15:13:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US