LONG
-
If oracle recommends not using LONG columns and using LOB columns instead at every opportunity. Then why is the data dictionary still riddled with them?
-
Backwards compatibility? ?
-
@PleegWat It's Oracle. The answer must be, so they can charge you extra to fix it.
-
TIL.
I was initially wondering why you'd want to store a 32 bit number in a blob...
-
@PJH wait, why does FLOAT require up to 22 bytes!?
-
@PJH wait, why does FLOAT require up to 22 bytes!?
It tells you in the description (I think):
A
FLOAT
value is represented internally as aNUMBER
I suspect IEEE754 wasn't a thing when it was first written, and it's been kept for backward compatibility
-
@Gąska There are also BINARY_FLOAT and BINARY_DOUBLE, which take 5 and 9 bytes respectively.
NUMBER is a decimal floating point type. Each byte encodes 2 decimal digits, for a maximum of 40 decimal digits of precision.
A
FLOAT
value is represented internally as aNUMBER
I suspect IEEE754 wasn't a thing when it was first written, and it's been kept for backward compatibility
There is also thou shalt not store amounts of money in a binary floating point type.
-
@Gąska There are also BINARY_FLOAT and BINARY_DOUBLE, which take 5 and 9 bytes respectively.
NUMBER is a decimal floating point type. Each byte encodes 2 decimal digits, for a maximum of 40 decimal digits of precision.
A
FLOAT
value is represented internally as aNUMBER
I suspect IEEE754 wasn't a thing when it was first written, and it's been kept for backward compatibility
There is also thou shalt not store amounts of money in a binary floating point type.
That's what
NUMBER
is there for. One assumes...
-
NUMBER is a decimal floating point type. Each byte encodes 2 decimal digits, for a maximum of 40 decimal digits of precision.
Am I reading this right? The most basic data type in all databases is BCD-encoded!? Holy hell. I knew Oracle is bad - I knew they're very very very bad at everything - but I still didn't expect this.
-
Am I reading this right? The most basic data type in all databases is BCD-encoded!? Holy hell. I knew Oracle is bad - I knew they're very very very bad at everything - but I still didn't expect this.
You have much to learn. As do I; I was assuming they were using fixed width text files for their columns (and that Oracle's actually all written in COBOL or something), but it seems they're a bit more efficient than that. Huh…
-
fixed width text files
It's effectively running its own filesystem inside those data files. Who knows what's inside. I suspect it's all tagged length though.
-
It's effectively running its own filesystem inside those data files.
I suppose that makes sense given that it used to be the case that the DB wanted raw disk partitions to work with for its storage. IIRC, they claimed that this was for reliability which always made me mentally go
-
@dkf I'm not sure, but it was probably designed for minicomputers without a filesystem, or indeed an operating system fit for the application.
-
-
Store everything in VARCHAR2. Problem solved.
-
@loopback0 said in LONG:
Store everything in VARCHAR2. Problem solved.
Someone told me sap R3 does that and I don't know if it's a poe or no.
-
@loopback0 said in LONG:
Store everything in VARCHAR2. Problem solved.
Using one EAV table underneath it all...
-
@dkf I'm not sure, but it was probably designed for minicomputers without a filesystem, or indeed an operating system fit for the application.
I decided to try if I could find out the reasons. Instead, I came across this line that I thought some here might appreciate:
The current version of Oracle Database is the result of over 35 years of innovative development.
(source)
-
It's effectively running its own filesystem inside those data files. Who knows what's inside. I suspect it's all tagged length though.
There is one "config" file required to start up an oracle instance, which is essential some string settings padded with a binary prefix and a \0 postfix to be a 4k block. If the file content is not 4k the dmbs refuses to start.
And of course you create that file with a tool from a regular textfile with just the strings...
-
@OloEopia is it plausible scenario that the data contained in text config will itself exceed 4kB?
-
@OloEopia is it plausible scenario that the data contained in text config will itself exceed 4kB?
My local installation has about 950 bytes of sensible data in it, personally I don't want to know what happens if you exceed 4kB
-
There is one "config" file required to start up an oracle instance, which is essential some string settings padded with a binary prefix and a \0 postfix to be a 4k block. If the file content is not 4k the dmbs refuses to start.
And of course you create that file with a tool from a regular textfile with just the strings...
Well, once you implement the stupid binary config file solution, you must provide a tool to create it