也就是说假如我定义了一个Varchar2(100),那么最多能插入100个字节
如果我插入50个字节是不是占用数据库存储空间就是50个字节
如果没有任何数据插入那么不占用数据库空间

解决方案 »

  1.   

    Small VARCHAR2 variables are optimized for performance, and larger ones are optimized for efficient memory use. The cutoff point is 2000 bytes. For a VARCHAR2 that is 2000 bytes or longer, PL/SQL dynamically allocates only enough memory tohold the actual value. For a VARCHAR2 variable that is shorter than 2000 bytes,PL/SQL preallocates the full declared length of the variable. For example, if you assign the same 500-byte value to a VARCHAR2(2000 BYTE) variable and to a VARCHAR2(1999 BYTE) variable, the former takes up 500 bytes and the latter takes up 1999 bytes.
      

  2.   

    定义了一个Varchar2(100),那么我最多能插入100个字节,如果我插入50个字节是占用数据库存储空间就是50个字节,如果没有任何数据插入那么不占用数据库空间!!!
      

  3.   

    那这么说数据表中类型为Varchar2字段的定义是不是越长越好(有长度限制的字段除外)??这样好像又觉得不对
      

  4.   

    假设建表的SQL语句全部存放在文件d:\createtable.sql,
    在SQL Plus 里输入: @d:\createtable.sql ;然后执行,即可全部创建。