Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.243
  HXTT Cobol 5.0.242
  HXTT DBF 7.1.243
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel 6.1.246
  HXTT Json 1.0.214
  HXTT Paradox 7.1.242
  HXTT PDF 2.0.242
  HXTT Text(CSV) 7.1.242
  HXTT Word 1.1.242
  HXTT XML 4.0.243
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
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
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
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
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
>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
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