solution export looses numeric(12,2) decimals

Hello,
I exported a Solution from 6.0.4 which contains a table with a field ninprnabkfr with 2 decimals ( numeric(12,2) )
the postgres definition with pgadmin III looks like:

CREATE TABLE adpg
(
view fields.....
  mutuser character varying(3) NOT NULL,
  id serial NOT NULL,
  ninprnabkfr numeric(12,2),
  sollbet integer,
  err_grpziel character varying(1),
  grpleit_pers integer,
..... more fields
  CONSTRAINT adpg_pkey PRIMARY KEY (id )

After import in 6.1.0 i get the error :

localhost_pg_lohnplus->adpg->ninprnabkfr" column difference. (NUMBER(id:2), length: 19, scale: 2, allowNull: true) in DB <-> (NUMBER(id:2), length: 12, allowNull: true) in DB information file. The DB information on this column differs from the actual column in the DB.	adpg.dbi	/resources/datasources/localhost_pg_lohnplus	JSON file	Database information inconsistency

So the difference is the scale: 2
I checked the solution-exportfile and found the definition

- <column creation_order_index="13">
  <name>ninprnabkfr</name> 
  <datatype>2</datatype> 
  <length>12</length> 
  <allow_null>1</allow_null> 
  <system_value>-1</system_value>

this is how it looks in servoy 6.0.4 befor export
[attachment=1]Print_Screen_01062.jpg[/attachment]

this is how it looks in servoy 6.1.0 after import
[attachment=0]Print_Screen_01061.jpg[/attachment]

and interesting:
I let Servoy 6.1.0 create all fields in an new, blank, empty database douring import solution. The new table
contans a field with the following size:

ninprnabkfr numeric(19,2),

Question 1:
Is scale: 2 for numeric fields supported in 6.0.x ?

Question 2:
I tried to add a new numeric field in servoy 6.1.0 with decimals 2 (scale: 2) but servoy also changes it to field length 0
Is scale: 2 for numeric fields supported in 6.1.0 ?

thank you for any ideas
regards

Just an idea: did you check the locale? It seems to me that this has something to do with the way the comma is read by Servoy. If the number format is set, say, to the US standard the comma is read as a thousand separator, not decimal. I am suggesting this because I too had similar troubles in the past caused by number format settings.

[24.09.2012] PS: sorry, but I misread your post. I thought that you were referring to the import of the actual data, not the column definition. So my comment is completely wrong.

Alessandro,

Currently, Servoy does not export the scale to the database info section of the .servoy file.
We will look into improving that in the future.

In the table editor, the length is really only used with TEXT columns.

Rob

But if I do “Synchronize with DB Server information”, the decimals gets importet an showed correct.
EDIT: This was in early Versions of Servoy, maybe back to Servoy 5.x

Thats why I didn’t detect this kind of “unfinished possibility” to administrate the fields in Servoy.

If I administrate it in a external Datadictionary/Design-Tool I can’t import the Desription (used for tooltips).

So that means, the fields-administration should be done a bit in a external Tool and a bit in Servoy and the
deployment is lots of manual work on every Clients DB ( no change of the size of existing fields, no erase
of depreciated fields, manual taking care of the decimals) ?

regards

stefanoni:
But if I do “Synchronize with DB Server information”, the decimals gets importet an showed correct.

regards

it doesn’t work with servoy 6.1.2 and I get an error for every numeric field !
I see noway to solve it or to work arround.

so i filed a case

How can I deploy a Solution in this case :

  • The Postgres DB on the Clients-Server contains numeric fields with decimals.
  • The Developer Postgres DB also contains numeric fields with decimals.
  • The Fields-Deskription in the Developer can not be edited to decimals in the “Servoy DB information”
  • The “Import-Table structure” in the Developer doesn’t read the decimals
  • The Developer shows errors for each field with decimals (column difference between “DB information” an the Postgres DB)
  • the solution can not be exportes with all this errors (EDIT: I could export the solution, even with errors)
  • maybe (not really tried !) if I import the Solution on the Clients Server, it changes all numeric fields and I loose the Decimals-Value ?

I’m wondering that nobody else struggles with this problem. Anybody else uses numeric fields with decimals in its Postgres ?
Thank you for giving me a feedback

Alessandro,

When the table and columns specified in the .servoy file are already existing, Servoy will not change anything to the data model.
It will update column info in the repository.
So if you create the tables the way you want before importing the solution, that is the definition that is used.
The import will add/update the extra information, like the column description in the repository.

Hope this helps,

Rob

rob,
With this facts I can go on and create manually all numeric fields in a new installed DB and then let Servoy do the rest during solution-import.
An acceptable workaround for me.

Rob, thank you very much for help me to understand this behaver.

regards