i realize my PK doesn’t increment even i told SC to ‘auto-increment’ while doing app configuration
Kindly refer to my attachment below and let me know if i miss out anything
Thanks
i realize my PK doesn’t increment even i told SC to ‘auto-increment’ while doing app configuration
Kindly refer to my attachment below and let me know if i miss out anything
Thanks
[QUOTE=weilies;24477]i realize my PK doesn’t increment even i told SC to ‘auto-increment’ while doing app configuration
Kindly refer to my attachment below and let me know if i miss out anything
Thanks[/QUOTE]
Set the database column to auto increment
Don’t do it in sc
Kev
[QUOTE=Kdriscoll;24478]Set the database column to auto increment
Don’t do it in sc
Kev[/QUOTE]
i tried to maximize SC usage.
I was wrong, after i use ‘auto-increment (MANUAL)’ and it worked!
When you set auto increment in the database you have to set scriptcase to ‘auto-increment (AUTO)’ . But if you do not set in the database you have to set scriptcase to ‘auto-increment (MANUAL)’ . If you enable the app’s debug mode you will see that scriptcase will do auto increment the field with a select with max function.
Paulo, my problem with that approach is that if two or more users want to insert a record at the same time, they will all have the same id. “Calculated by the database” sounds like the right choice to me because the database is then reserving the max id for you and providing a new number to the next concurrent user. The downside, which I am awaiting a solution to, is that Scriptcase does not seem to acquire the newly assigned id after insert and so you are not able to manipulate the row again until you reload the form.
UPDATE: I finally solved the problem of getting the ID after inserting a record.
http://www.scriptcase.net/forum/showthread.php?6475-Insert-does-not-return-an-ID-Immediate-Deleting-fails-on-Editable-Grid