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: Thomas Kellerer <JUAXQOSZFGQQ_at_spammotel.com>
Date: Thu, 12 Apr 2007 00:26:48 +0200
Message-ID: <5855l8F2ehq2eU1@mid.individual.net>

sybrandb_at_hccnet.nl wrote on 12.04.2007 00:14:
> On 11 Apr 2007 14:06:42 -0700, "Anoop" <anoopkumarv_at_gmail.com> wrote:
>

>> never mind all - I figured out the solution. It was the comments that
>> I had included in the file. Once I removed the comments (/* XXX */),
>> it works perfectly, no duplicates at all.
>>
>> But still - beats me: Why would sqlplus insert duplicates if there are
>> comments like /* XXX */.

>
> The answer to this is very simple: you don't have primary or unique
> keys on the affected table and the / means 'run the current buffer'

The SQL*Plus manual says that /* XXX */ is a valid comment inside a SQL script so why does SQL*Plus interpret the / as "run the current buffer"

At least in the OP's initial example no comment was placed in between SQL keywords which is not allowed by SQL*Plus because "SQL*Plus does not have a SQL or PL/SQL command parser" (very strange design though: a tool that runs SQL statements does not have a SQL parser...)

For the OP, here is the reference from the manual: http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm#sthref991

Thomas Received on Wed Apr 11 2007 - 17:26:48 CDT

Original text of this message

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