File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Identity feild in Sybase. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Identity feild in Sybase." Watch "Identity feild in Sybase." New topic

Identity feild in Sybase.

Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Hi all,

I am using Syabseand I have a table that contains one feild set as employee_id numeric(10,0) IDENTITY I need ti update a record to this table with my own empoloyee_id,it will works only after when execute this command
set IDENTITY_INSERT employee_tbl on
That is ok and i insert the row.But i need to update the employee id of one row,like....

update employee_tbl set employee_id=2145 where User_Id='minu'

First I execute the "set IDENTITY_INSERT employee_tbl on" and then i execute the update command,but it show an error like this...

Error: Illegal attempt to update identity field 'employee_id'.

How can i update this record..?? Please anyone help me ...........

Thanks in Advance

God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
I agree. Here's the link:
subject: Identity feild in Sybase.