Home » Developer & Programmer » JDeveloper, Java & XML » Oracle Data Dictonary
Oracle Data Dictonary [message #92654] Mon, 08 November 2004 03:51 Go to next message
marco
Messages: 46
Registered: March 2001
Member
Hello,

How can I find out what the maximum space of one row in a specific table is.

The Query select * from user_tab_columns

returns all columns and their datatypes. But how shall I interpret the value of the column Data_Length ?? Varchar2 returns the number of characters, but how about the Type Number --[>] returns 22. That can not be 22 Bytes ?? Date is 7.

 

 

 

 
Re: Oracle Data Dictonary [message #92686 is a reply to message #92654] Tue, 23 November 2004 04:38 Go to previous message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Hi,

You can use the DUMP() function to see how data is stored in a particular column. Example:

SQL> CREATE TABLE tab1 (dateval DATE, charval CHAR(10), varcharval VARCHAR2(10));

Table created.

SQL>
SQL> INSERT INTO tab1 VALUES (sysdate, 'qwerty', 'qwerty');

1 row created.

SQL>
SQL> SELECT dateval,    DUMP(dateval),
  2         charval,    DUMP(charval),
  3         varcharval, DUMP(varcharval)
  4  FROM   tab1;

DATEVAL     DUMP(DATEVAL)
----------- --------------------------------------------------
CHARVAL     DUMP(CHARVAL)
----------- --------------------------------------------------
VARCHARVAL  DUMP(VARCHARVAL)
----------- --------------------------------------------------
23-NOV-2004 Typ=12 Len=7: 120,104,11,23,17,45,30
qwerty      Typ=96 Len=10: 113,119,101,114,116,121,32,32,32,32
qwerty      Typ=1 Len=6: 113,119,101,114,116,121


Best regards.

Frank
Previous Topic: CREATE OR REPLACE DIRECTORY
Next Topic: Java.lang.noclassdeffounderror
Goto Forum:
  


Current Time: Thu Apr 25 04:19:53 CDT 2024