Subject | Re: [ib-support] primary key not enforced after recreating the table |
---|---|
Author | Ann W. Harrison |
Post date | 2002-12-06T17:07:18Z |
At 09:58 AM 12/5/2002 -0700, David Garamond wrote:
time, can you insert duplicates with ISQL?
Regards,
Ann
www.ibphoenix.com
We have answers.
>first i create an empty database using isql, ... then iNo.
>run the following python code
>(which basically [re]create a simple table and fill it with 20,000 rows):
>...
>cur.execute("CREATE TABLE T1 (i INT NOT NULL PRIMARY KEY, s VARCHAR(250))")
>con.commit()
>...
>p("Inserting...")
>for i in range(20000):
> cur.execute("INSERT INTO T1 VALUES (?,?)", (1,''))
>
>p("Committing...")
>con.commit()
><<<
>
>and execution fails at the second row insert...
>
>then i run the program again. this time, all rows are inserted
>successfully! after the program completes, i check with isql. there is
>20,000 records, each with i=1. 'USE INDICES' shows:
>
> RDB$PRIMARY2 UNIQUE INDEX ON T1(I)
>
>so the PK index is still there. (right?)
>
>i wrote an equivalent perl script using DBD::InterBase, and it produces
>the same thing.
>
>is this normal?
> i'm baffled.Likewise, I'm sure. After you run the program for the second
time, can you insert duplicates with ISQL?
Regards,
Ann
www.ibphoenix.com
We have answers.