For those who use database sequences things changed a bit in Servoy 4. The table editor (that is the data providers tab) doesn't allow you to type sequence names longer than 30 characters !
This is different of how things work in Servoy 3.5.x and below.
I filed issue #165822 for this.
I also noticed when you don't provide a sequence name in the table editor it will make one up for you using the following format: seq_tablename_pkname. Which is good.
BUT it does apply that same 30 character limit on it and will clip the name somewhere in the middle.
To make matters worse when a sequence name doesn't exist in the back-end database it will create one for you, silently .
This also happens when you make a typo when entering in the sequence name yourself. This is very much new behavior in comparison with Servoy 3.5.x and below and on the whole I think it's a nice addition that it creates one for you.
But I also think that Servoy should notify the developer that this particular database sequence doesn't exist yet and if he/she wants to create one in the back-end yes or no. I am sure any DBA will agree .
I filed feature request #165838 for this.
So to work around all of this you can do the following;
Go to the Navigator view. If you don't have that view in your perspective than you can add it by selecting in the menubar > Window > Show View.
In the Navigator you can see all files in your local workspace. In the resources folder you find the .dbi files (in datasource/<dbname>/ ).
By right-clicking and selecting Open With > Text Editor you see the following:
- Code: Select all
columns:[
{
allowNull:false,
autoEnterSubType:2,
autoEnterType:2,
creationOrderIndex:0,
dataType:-5,
flags:1,
name:"pfx_id"
},
etc.
Change the 'autoEnterSubType' value to 1 and add 'databaseSequenceName' like so:
- Code: Select all
columns:[
{
allowNull:false,
autoEnterSubType:1,
autoEnterType:2,
creationOrderIndex:0,
dataType:-5,
databaseSequenceName:"seq_some_longer_tablename_pfx_id",
flags:1,
name:"pfx_id"
},
etc.
Save the dbi file and you can start entering data using the correct sequence name.
Hope this helps.