Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: INSERT creates duplicate records
I believe that Refresh call causes your insert statement to execute
second time. This means improper use of oraSqlStmt - this object
is for queries (select statements) only.
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "Torsten Schulz" <tos_theblocks_at_celerity-consulting.com> wrote in message news:880be48f.0303170903.48e9db5e_at_posting.google.com...Received on Mon Mar 17 2003 - 12:47:51 CST
> Ok,
>
> I am officialy going nuts. This is so simple, that I can't believe I
> didn't find anything on Google.
>
> Database: Oracle8i Enterprise Edition Release 8.1.7.3.0
>
> I create a table:
> SQL> create table test (x varchar2(10));
>
> I create an VB app with OO4O (Oracle InProc Server 3.0):
> Private Sub Command1_Click()
> Dim oraSession As oraSession
> Dim oraDatabase As oraDatabase
> Dim oraSqlStmt As oraSqlStmt
>
> Set oraSession = CreateObject("OracleInProcServer.XOraSession")
> Set oraDatabase = oraSession.OpenDatabase("dbname", "user" & "/" &
> "password", ORADB_ORAMODE)
> Set oraSqlStmt = oraDatabase.CreateSql("INSERT INTO test (x)
> VALUES ('abc')", ORASQL_FAILEXEC)
> oraSqlStmt.Refresh
> Set oraSqlStmt = Nothing
> End Sub
>
> When I run this function, I get:
> SQL> select * from test;
>
> X
> ----------
> abc
> abc
>
> The INSERT was fired twice. No triggers involved or anything. The same
> INSERT in SQL Plus is executed only once.
>
> Any ideas? Help is greatly appreciated...
>
> Torsten