[Solved] PostgreSQL-JDBC numeric field truncated problem

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
awid
Posts: 3
Joined: Fri Dec 17, 2010 3:41 am

[Solved] PostgreSQL-JDBC numeric field truncated problem

Post by awid »

I have upgraded from 3.2.1 to 3.3.

I am using a form created in Base to input transaction details into a postgres database using the jdbc interface.
My problem is that when I input a $ amount into the transamount field this field is truncated in that only the dollar amount is inserted.
Your help would be much appreciated. This worked OK in 3.2.1. Test connection & Test class works OK.

Postgresql version 8.3.11 and postgresql-jdbc 8.3.603

Table field types below

transid serial NOT NULL,
transcode character varying(50),
transdate timestamp without time zone,
transdescription character varying(255),
transamount numeric,
CONSTRAINT tranststpk PRIMARY KEY (transid)
Last edited by awid on Sun Mar 06, 2011 4:27 am, edited 1 time in total.
LibreOffice 3.4.4 Build(402) Ubuntu 11.10
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: PostgreSQL-JDBC numeric field truncatied problem

Post by r4zoli »

What type of form controls you use on transamount field?
Formatted field or Currency field?
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
awid
Posts: 3
Joined: Fri Dec 17, 2010 3:41 am

Re: PostgreSQL-JDBC numeric field truncatied problem

Post by awid »

I am using a formatted field.
Formatting: Category - Number Format code #.00
thanks
LibreOffice 3.4.4 Build(402) Ubuntu 11.10
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: PostgreSQL-JDBC numeric field truncated problem

Post by r4zoli »

I think you use numeric type wrongly, not defined scale parameter: http://www.postgresql.org/docs/8.3/inte ... IC-DECIMAL
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
awid
Posts: 3
Joined: Fri Dec 17, 2010 3:41 am

Re: PostgreSQL-JDBC numeric field truncated problem

Post by awid »

That was the problem - thanks for your help.
LibreOffice 3.4.4 Build(402) Ubuntu 11.10
Post Reply