Skip to main content

PDF TEST

DIFFERENCE BETWEEN VARCHAR AND VARCHAR2...

 VARCHAR:

The VARCHAR data type is used to store character values. It's fixed value data type means once it's initialized, we cannot change the size at the execution time. So, it's called static data type. It can store maximum 2000 bytes of character data. For each character one byte will be stored in memory.

If you store 5 characters in varchar(10), the 5 bytes will be stored in oracle and other 5 bytes will lead to memory wastage.

Varchar is external data type. It's ANSI SQL standard and it's definition may change in future by oracle.

Varchar can identify null and empty strings separately.


VARCHAR2:

The VARCHAR2 data type is also used to store character values. It's variable length -data type means it's character value can be changed while execution. So, it's called dynamic data type. It can store maximum 4000bytes of data. For  each character one byte will be stored in memory. Since it's dynamic data type, memory will not wasted.

If you store 5 characters in varchar2(10), only 5 bytes will be stored in oracle and no memory will be wasted(extra spaces will be truncated).

Varchar2 is internal data type. It's oracle standard and it's definition won't change in the future.

Varchar2 cannot identify null and empty strings separately, both are same for it.

It's advisable to use VARCHAR2 instead of VARCHAR.

Comments

Popular posts from this blog

How to create PLAY & PAUSE(STOP) buttons in Macromedia Flash 8...

POST - 2 How to create PLAY & PAUSE(STOP) buttons in Macromedia Flash 8 Step-1 Open Macromedia Flash 8 and create New Flash Document. Step-2 Draw an Oval by clicking Oval in tools section. Step-3 Now in Layer-1 right click on Frame No. 60 and select Insert Keyframe. Step-4 Select(with selection tool in tools section) and drag Oval(Object) to your last position.(Where you want to end motion effect) Step-5 Now right click on Frame No. 30 and select Create Motion Tween. Step-6 Now add new layer(By right clicking on existing layer and choosing Insert Layer) and draw two buttons using rectangle tool in tools section.(Make sure to make both these buttons of different colours. You can select colour before drawing from tools section) Step-7 Now right click on button and select Convert to symbol...Give proper name to button and make sure to select Type as Button.(Do this for both buttons. Names must be different) Step-8 (Optional) You can add text on your buttons from tools section... Step-...

Write a CPP program to swap two integer numbers with the use of reference variable...

 POST -  All the code given below is compiled using turbo CPP and working totally fine but if you are using any new IDE there might be some difference in code... #include<iostream.h> #include<conio.h> void swap (int &x , int &y) {      int temp;     temp=x;     x=y;     y=temp; } main() {      int a, b;      clrscr();      cout<<"Enter The Value Of A : ";      cin>>a;      cout<<"Enter The Value Of B : ";      cin>>b;      swap(a,b);      cout<<"After Swapping..."<<endl;      cout<<"A= "<<a<<endl;      cout<<"B= "<<b<<endl;      getch();      return(0); }  OUTPUT: