Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT ACCESS
Precision and scale set incorrectly
Kevin
2006-05-23 13:13:01.0
We have a set of fields in a view in DB2 that I am using to create a table in access for a data export the fields in the view are all Decimal(31,3) in access the fields are being created as number field size of decimal percison = 0 and scale = 0 because of these percision and scale values all of the mnumbers are truncated to integer types. I am using the following routine to create the table:

conn = global connection object to DB2 database;
accessConn = global connection object to Access database;

protected int createTable( String SQL, String tableName )
throws SQLException
{
int result = 0;
Statement statement = null;
PreparedStatement pstmt = null;
ResultSet rs = null;

try
{
statement = conn.createStatement();
//statement.setFetchSize(1000);
rs = statement.executeQuery(SQL);
String createTableSQL ="create table if not exists " + tableName + " ?;";
pstmt = accessConn.prepareStatement(createTableSQL);
pstmt.setObject(1,rs); //insert a resultSet into a new table <>
pstmt.executeUpdate();
}
catch( OutOfMemoryError e )
{
e.printStackTrace();
}
finally
{
statement.close();
if( rs != null )
{
rs.close();
}
if( pstmt != null )
{
pstmt.close();
}
}

return result;
}
Re:Precision and scale set incorrectly
HXTT Support
2006-05-23 21:42:48.0
Supported. Please download the latest package.
Re:Re:Precision and scale set incorrectly
Kevin
2006-05-24 08:06:41.0
This fixed work for most fields except the fields over 28 digits. Access' maxium precision length is 28 so any field that the HXTT library set over that does not display properly. The precision needs to be capped to 28.
Re:Re:Re:Precision and scale set incorrectly
HXTT Support
2006-05-24 08:26:30.0
Supported.
Re:Re:Re:Re:Precision and scale set incorrectly
Kevin
2006-06-12 12:25:54.0
I just updated to the newest version of the access library off the website and the capping of perction at 28 digits is no longer working it creates the number fields with a percision of 31 again.
Re:Re:Re:Re:Re:Precision and scale set incorrectly
HXTT Support
2006-06-12 19:38:28.0
Sorry. Fixed again. Please download the latest package.
Re:Re:Re:Re:Re:Re:Precision and scale set incorrectly
Kevin
2006-06-22 09:44:57.0
This fix seems to work fine on a windows box when I test it but when I deploy this to our production system on linux it does not seem to work it still creates the fields with a percision of 31 instead of 28.
Re:Re:Re:Re:Re:Re:Re:Precision and scale set incorrectly
HXTT Support
2006-06-22 17:21:33.0
Check whether your classpath in Linux contains an old package
Re:Re:Re:Re:Re:Re:Re:Re:Precision and scale set incorrectly
Kevin
2006-06-23 06:38:18.0
We did check that. There isn't anthor a package on the machine and we tested it on aonther linux machine and the same thing happend.
Re:Re:Re:Re:Re:Re:Re:Re:Precision and scale set incorrectly
HXTT Support
2006-06-23 07:02:06.0
I checked too. Please download the v1.2.023 package and try it again. Thanks for your patience.
Re:Re:Re:Re:Re:Re:Re:Re:Precision and scale set incorrectly
HXTT Support
2006-06-23 07:11:22.0
BTW, if you wish to execute your same code, you should run "drop table if exists tableName"since "create table if not exists " + tableName + " ?;" won't create a table if the old table exists.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap