BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Introduction to Database (http://bzupages.com/314-introduction-database/)
-   -   What is the difference between char,varchar2? Oracle table creation (http://bzupages.com/f314/what-difference-between-char-varchar2-oracle-table-creation-2736/)

.BZU. 12-03-2009 04:54 AM

What is the difference between char,varchar2? Oracle table creation
 
Char is stored as a fixed length string, Varchar2 is stored as a variable
length string. Thus, if you define the table:
Code:

create table mytable (
charfield Char(50),
varfield Varchar2(50));

If you perform the following insert: Insert Into mytable
(charfield,varfield) Values ('Hello','Hello');
The first fields will take 50 bytes while second will take only 5. It is
usually recommended to store strings as varchar.


All times are GMT +5. The time now is 12:30 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.