Home > database >  Why in PB9 dynamically create the ACCESS data table such as table contains numeric type fields is wr
Why in PB9 dynamically create the ACCESS data table such as table contains numeric type fields is wr

Time:09-24

Why in PB9 dynamically create the ACCESS data table such as table contains numeric type fields is wrong is how to return a responsibility, statements below
The CREATE TABLE hydl_hthq_hqdxxb (HQDLBXH Integer not null, HQDBH String (50) not null,
HQDMC String (200) not null, HTBH String (100), TBRQ String (8) not null, qcrid Integer not null, JFMC String (200) not null, yfmc String (200) not null, HTZJ numeric (10, 2) not null,
Yt String (50), the second String (10), CGXS Integer, CGXJ String (50), hqrid Integer not null,
HQWBBZ Integer not null, HQRZWXH Integer not null, hqryj String (200), QBRQ String (8),
PRIMARY KEY (HQDMC hqrid));
If the HTZJ numeric (1, 2) not null as soon as the delete was no problem with the CREATE TABLE mistakes, please master guide

CodePudding user response:

Numeric only numeric (6, 2), if you want more precision, to use the double data type double

CodePudding user response:

Into a numeric (6, 2) or not and I found no matter I am to FLOAT (2) or REAL (2) are not have small digital field type cannot be created dynamically

CodePudding user response:

Tried it on, as if the decimal digits are automatically

The create tt (
The name char (10),
Tt double//in this way, is a double precision, but the decimal digits is automatically
)

CodePudding user response:

Dynamically created, I can't find the corresponding digital type.

But, in the ACCESS (hand table up), data type - & gt; Digital - & gt; Field size - & gt; The decimal - & gt; The accuracy of yourself to.

Normal business system, try not to use the precise number of DOUBLE/FLOAT.

Write a business system, the accurate number, in many cases, the calculation results is not controllable, can produce a lot of unnecessary BUG.

CodePudding user response:

Is another way to use the SQL statement to create, you can specify a decimal digits

SELECT 'aa' as the name, 'bb' as sex, 12345678.95 as tt INTO t_5

This will create a new table t_5, there are three fields
The name text
Sex text
Tt value type, 2 decimal places

And then to empty the data
The DELETE FROM t_5

CodePudding user response:

ACCESS the small digital only ACCESS the display digits, not the actual decimal places,
  • Related