Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
NUMERIC datatype with decimal places is transformed to FLOAT on table creation
Christian Metzner
2019-07-11 05:52:39.0
Hi together,

I'm creating a new database table using DBF_JDBC43.jar and hibernate.jar in a Spring Boot application, using native query. I wan't to transform a NUMERIC(5,3) column to VFP datatype 'N'. After creating the table and opening it in VFP 9.0 it shows that column is set to Float. Is there any reason for it or is it configurable?

Spring datasource is set up as following:
spring.datasource.url=jdbc:dbf:///?charSet=Cp1252
spring.datasource.driver-class-name=com.hxtt.sql.dbf.DBFDriver
spring.jpa.database-platform=com.hxtt.support.hibernate.HxttDbfDialect

Thanks and best regards!
Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation
HXTT Support
2019-07-11 06:25:08.0
Are you using

@Column(name = "YourColumn", precision = 5, scale = 3)
private BigDecimal variable4YourColumn;
Re:Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation
Christian Metzner
2019-07-11 07:22:12.0
Hi, yes I'm using BigDecimal with @Column definition

Native Query excerpt:
@Query(value = "CREATE TABLE IF NOT EXISTS TPDISS_STR (" +
...
"ENTF_I DECIMAL(5,3)," +
...
")", nativeQuery = true)
void createTable();

Entity definition excerpt:
@Entity
@Table(name = "")
public class Streckenabschnitt {
...
@Column(name = "ENTF_I", precision = 6, scale = 3)
private BigDecimal entfernungGfdI;
...
}
Re:Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation
Christian Metzner
2019-07-11 07:23:12.0
I'm sorry, query type is "NUMERIC". It was just another try...
Re:Re:Re:Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation
HXTT Support
2019-07-11 09:18:48.0
>After creating the table and opening it in VFP 9.0 it shows that column is set to Float. Is there any reason for it or is it configurable?

Checked. VFP provides two types (N, F), which supports precision/scale. HXTT DBF use Float as default type for CREATE table.

The latest package has enabled N for Numeric.
Re:NUMERIC datatype with decimal places is transformed to FLOAT on table creation
Christian Metzner
2019-07-11 12:48:41.0
Hi, I've just downloaded the latest package and it works now. Thanks a lot!

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap