When we define varchar2 data type to particular column in table, same time we define its length or you can say its range but knowledge point is how many byte oracle server take? to store particular string or number values its depend upon the character set .So my this post explain to you how many byte oracle server take to store values.
Explanation:-
SQL> create table test(id varchar2(10);
table created
SQL> insert into test values('abcdefghij');
one row inserted
SQL>commit;
SQL> select length ('abcdefghij') from dual; **/ length is 10 so no error has been generated after execution of insert statement /*****
SQL> insert into test values('1234567891');
one row inserted
SQL> commit;
SQL> select length('1234567891') from dual; **/ length is 10 so no error has been generated after execution of insert statement /*****
LENGTH('1234567891')
--------------------
10
SQL>insert into test values('12345678910');
ERROR at line 1:
ORA-12899: value too large for column "SCOTT"."TEST"."ID" (actual: 11, maximum:
10)
**/ After execution of statement oracle server gives error because insert statement cross specified range /***
NOTE:- that's means oracle server allowed you to insert only number of numeric and string values as per you specified range of column while creation of table.
SQL> create table test1 (id VARCHAR2(10 byte));
Table created.
note:- now oracle server take only10byte data that means insert only those numeric and string values which within 10 bytes.if numeric or string values cross 10 byte range then oracle server gives error.
Subscribe to:
Post Comments (Atom)
work on autovacuum postgreSQL parameter
In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...
-
WARNING: 2019-06-15 06:40:03 WARNING OGG-02045 Database does not have streams_pool_size initialization parameter configured. Solut...
-
[INS-41112] Specified network interface doesnt maintain connectivity across cluster nodes issue and solution 01:- restart both node an...
-
error Details : SQL> alter user C##GGATE default tablespace GGUSER; alter user C##GGATE default tablespace GGUSER * ERROR at line ...
No comments:
Post a Comment