File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Identity feild in Sybase." Watch "Identity feild in Sybase." New topic
Author

Identity feild in Sybase.

MInu
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Identity feild in Sybase.
 
Similar Threads
How to solve Repeated column in mapping for entity:
getGeneratedKeys()
Problem with OJB
Update Table Nested Query (Using Function)
SQL Select: GROUP BY Having Count