Announcement

Collapse
No announcement yet.

Scriptcase auto increment PK doesn't work

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scriptcase auto increment PK doesn't work

    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
    Attached Files

  • #2
    Originally posted by weilies View Post
    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
    Set the database column to auto increment
    Don't do it in sc

    Kev

    Comment


    • #3
      Originally posted by Kdriscoll View Post
      Set the database column to auto increment
      Don't do it in sc

      Kev
      i tried to maximize SC usage.
      I was wrong, after i use 'auto-increment (MANUAL)' and it worked!

      Comment


      • #4
        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.

        Comment


        • #5
          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/show...-Editable-Grid
          Last edited by Sardius; 06-14-2014, 08:37 AM.
          Rod - Developer

          Comment

          Working...
          X