Add new record error

Questions and answers regarding general SQL and backend databases

Add new record error

Postby Niall » Fri Dec 12, 2003 12:40 pm

Hi

Can anybody tell me what the following error message means please? It occurs when trying to add a new record.

"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert explicit value for identity column in table 'WHouseLocation' when IDENTITY_INSERT is set to OFF. [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert explicit value for identity column in table 'WHouseLocation' when IDENTITY_INSERT is set to OFF."

Cheers

Niall
Niall
 
Posts: 14
Joined: Tue Sep 09, 2003 12:59 pm

Postby Niall » Fri Dec 12, 2003 12:58 pm

Ahh. I think I may have sussed this myself.

Is it because the field is a PK and is being incremented on the server side?

Niall
Niall
 
Posts: 14
Joined: Tue Sep 09, 2003 12:59 pm

Postby Jan Aleman » Sat Dec 13, 2003 3:15 pm

Correct, PK's managed by server are not supported in 1.2, they will be supported in an upcoming version of Servoy.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

IDENTITY_INSERT support

Postby megaquests » Fri Mar 19, 2004 12:44 pm

Hi, do you know if this is now supported in v 2.0 rc9?
I get the same error that Niall was getting.

Is it possible to add a record in servoy with the field id being incremented on the server side?

thanks
Eugene
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

Postby Jan Aleman » Fri Mar 19, 2004 12:55 pm

Yes it should work fine in rc9. Have you set the column options to use a server generated pk?
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

IDENTITY_INSERT support

Postby megaquests » Fri Mar 19, 2004 2:39 pm

thanks Jan, that did the trick :D
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

server generated pk

Postby megaquests » Fri Mar 19, 2004 2:54 pm

Is it possible to indicate that all pk's in a database are server generated in case you have many tables? or do you have to set each pk for each table individually

thanks
eugene
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

Postby Jan Blok » Tue Mar 23, 2004 7:01 pm

We discovered an issue in sequence auto assinging to PK columns in Sercoy 2.0 rc9, will be fixed in Servoy 2.0 rc10
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

sequence auto assinging

Postby megaquests » Tue Apr 20, 2004 7:49 am

Hi,

we are using Version R2 2.0 rc12-build 271
is it possible now to tell servoy that all tables in a database have db assigned pk's?
We can set them one at a time by hand it's not that difficult but with over 100 tables all with db assigned pk's it would be great to be able to click one button to say "All pk's are DB assigned" 8)
many thanks
Eugene
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

Postby Jan Blok » Tue Apr 20, 2004 10:10 am

That cannot be build for db_seq, you need to specify the sequence name, for db_identity we could build this.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 3 guests