Re: [SQL] Check before INSERT INTO

2008-02-12 Thread Richard Huxton
Shavonne Marietta Wijesinghe wrote: Even though n_gen is defined as a serial I can't let it handle the progressive key by its self since there is the need that some records should have the same value. Of course you can - the default is only provided if you don't provide your own. That's

Re: [SQL] Check before INSERT INTO

2008-02-12 Thread Shavonne Marietta Wijesinghe
t;; Sent: Tuesday, February 12, 2008 11:35 AM Subject: Re: [SQL] Check before INSERT INTO Shavonne Marietta Wijesinghe wrote: Thanks for the replies.. But my problem still continues even after setting the isolation level. Set oRs = oConn.Execute("SELECT N_GEN FROM MY_TABLE ORDER BY N_GEN::I

Re: [SQL] Check before INSERT INTO

2008-02-12 Thread Richard Huxton
Shavonne Marietta Wijesinghe wrote: Thanks for the replies.. But my problem still continues even after setting the isolation level. Set oRs = oConn.Execute("SELECT N_GEN FROM MY_TABLE ORDER BY N_GEN::INT DESC") If err <> 0 then 'If table not found GetFieldValue = "1" WriteToFile logfilepath,

Re: [SQL] Check before INSERT INTO

2008-02-12 Thread Shavonne Marietta Wijesinghe
;. Sadly both the current users get the value "6". Have i set the isolation level correctly?? Thanks Shavonne - Original Message - From: "Jean-David Beyer" <[EMAIL PROTECTED]> To: Sent: Monday, February 11, 2008 5:55 PM Subject: Re: [SQL] Check before IN

Re: [SQL] Check before INSERT INTO

2008-02-11 Thread Jean-David Beyer
Shavonne Marietta Wijesinghe wrote: > Thanks for the reply Grogory. I am trying to do a INSERT INTO. > > Here is my table. n_gen, n_sheet, tot_n_sheet are defined as Primary Key > (Serial not null) That is sure confusing. What could a DDL saying INTEGER n_gen SERIAL NOT NULL; INTEGER n_she

Re: [SQL] Check before INSERT INTO

2008-02-11 Thread Gregory Stark
"Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> writes: > Thanks for the reply Grogory. I am trying to do a INSERT INTO. > > Here is my table. n_gen, n_sheet, tot_n_sheet are defined as Primary Key > (Serial not null) > id | n_gen | n_sheet | tot_n_sheet > --+---+---

Re: [SQL] Check before INSERT INTO

2008-02-11 Thread Shavonne Marietta Wijesinghe
Thanks for the reply Grogory. I am trying to do a INSERT INTO. Here is my table. n_gen, n_sheet, tot_n_sheet are defined as Primary Key (Serial not null) id | n_gen | n_sheet | tot_n_sheet --+---+---+- a| 1| 1 | 1

Re: [SQL] Check before INSERT INTO

2008-02-11 Thread Gregory Stark
"Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> writes: > The user updates the DB via ASP. When 2 users click on the submit button at > the > same time, only 1 record is inserted. (ERROR: duplicate key violates unique > constraint "my_shevi_pkey") > > For example they both send a string like b

Re: [SQL] Check before INSERT INTO

2008-02-11 Thread Shavonne Marietta Wijesinghe
ehmm and where is it said that N_GEN should add 1 before inserting the record?? sorry i don't understand the help. Shavonne - Original Message - From: Kopljan Michael To: 'Shavonne Marietta Wijesinghe' Sent: Monday, February 11, 2008 1:45 PM Subject: RE: [SQ