This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have a table Members with columns MemberID, Name , IDNumber I use a keytable for ID Insertion, and everything is working great when IDNumber is not Identity column but when i set it to be Identity column (just identitiy column not primary Key - i need to do this because of our client business logic) then i'm unable to insert new records with LS in Members table. What i need is to be able to set IDNumber (this is for import of old Members from old database) and save it in databese, and if i don't set IDNumber then let database use auto increment functionality on that identity column Haris |
|
|
No Answer ? Maybe i didn't explain correctly, i need only auto increment column not identity as i wrote in the first post. |
|
|
Hi Haris, Sorry, I have been busy working on designer improvements to support your serialisation issue and have not yet had time to look at this. I hope to get round to it today. |
|
|
Cool :) i'll wait |
|
|
Hello Haris, I am not 100% sure I have understood you correctly but I think you are saying that: * You have an autoincrement column, IDNumber, in the database, and a corresponding field in the LightSpeed Member entity. * You want to be able to specify the value of IDNumber, but if you do not specify the value of IDNumber, you want the database to auto-populate it. * This is NOT about the IdentityColumn IdentityMethod -- you are not using the autoincrement column as your LightSpeed entity ID. In general I think this is not possible. For example in SQL Server I believe you cannot specify a value for an identity (autoincrement) column -- it is "owned" by the database. In MySQL I understand that autoincrement is bound up with identity -- a table's autoincrement column must also be its primary key (I may be wrong here!). You should therefore check your database documentation to find out whether what you want is possible in your database, and if so whether it is permissible to pass a value in an INSERT statement that means "let the database allocate a value" (e.g. passing NULL). If not, you will probably have to consider an alternative approach, such as always setting IDNumber on the client but having a key table-like "next ID number" table, a sequence or a stored procedure that the client can use to get unique database-allocated IDs. |
|
|
We have find solution for now (with SP) Thanks for your answer. |
|