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

Home -> Community -> Usenet -> c.d.o.server -> Re: Duplicate inserts but only through sqlplus

Re: Duplicate inserts but only through sqlplus

From: Anoop <anoopkumarv_at_gmail.com>
Date: 12 Apr 2007 04:14:26 -0700
Message-ID: <1176376465.966061.67460@l77g2000hsb.googlegroups.com>


On Apr 11, 11:31 pm, "Anoop" <anoopkum..._at_gmail.com> wrote:
> On Apr 11, 7:02 pm, "joel garry" <joel-ga..._at_home.com> wrote:
>
>
>
> > On Apr 11, 1:06 pm, "Anoop" <anoopkum..._at_gmail.com> wrote:
>
> > > SQL> set echo on
> > > SQL> set feedback on
> > > SQL> set verify on
> > > SQL> @c:/WSA_Domains_AM_april9.sql
> > > SQL> SET SCAN OFF
> > > SQL>
> > > SQL> insert into applications values ('WSA','Windows Server
> > > Admin','Windows Server Admin');
> > > 1 row created.
> > > SQL>
> > > SQL> /* Domains */
>
> > [snip]
>
> > > By Duplicates I mean that the data in some rows repeat in this step:
> > > insert into application_data values ((select max(application_data_id)
> > > +1 from application_data), 'WSA', 'Domain', 'cof.ds.xxx.com ', null,
> > > 0);
>
> > > So basically we find (after running the file) that cof.ds.xxx.com
> > > repeated twice instead of once. The file has only one row with the cof
> > > value - I am sure of that.
>
> > SQL> select * from dual;
>
> > D
> > -
> > X
>
> > SQL> /*
> > DOC>*/
> > SQL> / *
>
> > D
> > -
> > X
>
> > SQL>
>
> > > We have about 3000 insert statements in all. By putting commit
> > > statements in between we seem to reduce the number of duplicates, but
> > > I fail to see how that would help. Is it really necessary to add a
> > > commit after a specified number of inserts??
>
> > jg
> > --
> > @home.com is bogus.
> > New in 11g: oracle flashmobhttp://www.tokyomango.com/tokyo_mango/2007/04/video_cosplayer.html
>
> Thanks so much..... Sybrand Bakker, Thomas Kellerer, Joel Garry:
>
> You might have just hit the problem on the head. Of course / means to
> run what is in the buffer and since commit does a commit of the
> transaction and clears the buffer, we faced some improvement when we
> used the commit's in between.
>
> Thank you all - the problem is solved - although I would have expected
> Oracle Sqldeveloper (Raptor) to be at least similar if not more
> forthcoming in its messages.
> Also reading through Oracle's faq, comments need to be added using --
> and not really /* XX */
>
> Thank you all so much,
> Anoop

Doing some further analysis, here is what I think seems to be happening...

All rows that were duplicated had comments following them like this: /*xxx*/

there were no spaces between the /* and the comment and */. I think that makes a difference.
/* xxx */ <-- IS A VALID COMMENT
/*xxx*/ <-- IS NOT A VALID COMMENT and induces the / to run - again I think it is the trailing / that invokes the run last buffer and not the first / in /*.

Thanks,
Anoop Received on Thu Apr 12 2007 - 06:14:26 CDT

Original text of this message

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