Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Wie groß ist ein BIGINT(3) NOT NULL maximal? (https://www.delphipraxis.net/195745-wie-gross-ist-ein-bigint-3-not-null-maximal.html)

Codehunter 21. Mär 2018 14:51

Datenbank: MariaDB • Version: 10 • Zugriff über: ZEOS

Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Hallo!

Siehe Überschrift. Nach meinem Verständnis umfasst ein BIGINT(3) NOT NULL einen Wertebereich von -999 bis 999 oder sehe ich das falsch?

Grüße
Cody

mkinzler 21. Mär 2018 15:12

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Eigentlich geht BIGINT von -9223372036854775808 bis 9223372036854775807

Die Größenangabe 3 irritiert mich etwas. So etwas kenn ich eigentlich nur von NUMERIC oder DECIMAL

Codehunter 21. Mär 2018 15:24

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Siehe DDL von MariaDB 10 information_schema.CHARACTER_SETS:
Code:
CREATE TABLE `CHARACTER_SETS` (
   `CHARACTER_SET_NAME` VARCHAR(32) NOT NULL DEFAULT '',
   `DEFAULT_COLLATE_NAME` VARCHAR(32) NOT NULL DEFAULT '',
   `DESCRIPTION` VARCHAR(60) NOT NULL DEFAULT '',
   `MAXLEN` BIGINT(3) NOT NULL DEFAULT '0'
)
COLLATE='utf8_general_ci'
ENGINE=MEMORY

mkinzler 21. Mär 2018 15:29

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Dann wäre es ein Alias auf DECIMAL(3,0).

Codehunter 21. Mär 2018 18:50

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Danke dir.

Valle 21. Mär 2018 22:21

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Seid ihr euch sicher?

Ich zitiere mal aus Stackoverflow:

Zitat:

See http://dev.mysql.com/doc/refman/5.1/...ric-types.html

INT is a four-byte signed integer.

BIGINT is an eight-byte signed integer.

They each accept no more and no fewer values than can be stored in their respective number of bytes. That means 2^32 values in an INT and 2^64 values in a BIGINT.

The 20 in INT(20) and BIGINT(20) means almost nothing. It's a hint for display width. It has nothing to do with storage, nor the range of values that column will accept.

Code:
Practically, it affects only the ZEROFILL option:

CREATE TABLE foo ( bar INT(20) ZEROFILL );
INSERT INTO foo (bar) VALUES (1234);
SELECT bar from foo;

+----------------------+
| bar                 |
+----------------------+
| 00000000000000001234 |
+----------------------+
It's a common source of confusion for MySQL users to see INT(20) and assume it's a size limit, something analogous to CHAR(20). This is not the case.

mkinzler 22. Mär 2018 05:38

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Deshalb habe ich auch geschrieben, dass es mir komisch erscheint.

Die Angabe ist dann wohl nur bei zerofill relevant?

Codehunter 22. Mär 2018 09:33

AW: Wie groß ist ein BIGINT(3) NOT NULL maximal?
 
Genau solche Fragen hab ich mir auch gestellt: Muss ich mit AsInteger oder mit AsLargeInt auslesen? Man muss ja immer vom Worst Case ausgehen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz