本人没有条件测试,还请大家帮我的是一下上述三个名称能否用在Oracle中。
谢谢了。

解决方案 »

  1.   

    把列名用双引号括起来
    SQL> create table t3("_Identify" number,"_Locked" number,"_SortKey" number);Table created.SQL> insert into t3 values(1,1,1);1 row created.SQL> commit;Commit complete.SQL> select * from t3; _Identify    _Locked   _SortKey
    ---------- ---------- ----------
             1          1          1
      

  2.   

    中间有下划线没有关系吧?
    例如:fx_identify,  fx_locked,  fx_sortkey
      

  3.   


    直接不行,不过可以加双引号
    SQL> edit
    已写入 file afiedt.buf  1  create table test (_Identify varchar2(1),
      2  _Locked varchar2(1),
      3* _SortKey  varchar2(1))
    SQL> /
    create table test (_Identify varchar2(1),
                       *
    第 1 行出现错误:
    ORA-00911: 无效字符
    SQL> edit
    已写入 file afiedt.buf  1  create table test ("_Identify" varchar2(1),
      2  "_Locked" varchar2(1),
      3* "_SortKey"  varchar2(1))
    SQL> /表已创建。
    SQL> desc test
     名称                                      是否为空? 类型
     ----------------------------------------- -------- -------------------------- _Identify                                          VARCHAR2(1)
     _Locked                                            VARCHAR2(1)
     _SortKey                                           VARCHAR2(1)SQL> select "_Identify" from test;
    ------------------------------------------------------------------------------ 
    Blog: http://blog.csdn.net/tianlesoftware 
    网上资源: http://tianlesoftware.download.csdn.net 
    相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx 
    Q Q 群:62697716 
      

  4.   

    谢谢wh62592855,你可能帮我解决了一个大问题,因为有很多历史文件(Access和SQL SERVER格式)的列名是用下划线开头,如果要改是非常麻烦的。是不是Oracle中的特殊表名和列名,用双引号括起来即可,例如:Select "_Identify","_Locked", "_SortKey" From "_表A"也就说双引号类似SQL Server中的方括号,我在SQl Server中是这样处理的:Select [_Identify],[_Locked], [_SortKey] From [_表A]
      

  5.   

    呵呵 不客气你不可能摸透ORACLE的每一条明明规范
    因此当你在尝试以某个名称来命名表或者列的时候出现了错误
    你可以尝试使用""来把它们包起来 这样系统就不会特意的去检查或者误以为是关键词表名也是一样的
    SQL> create table _t4(id number);
    create table _t4(id number)
                 *
    ERROR at line 1:
    ORA-00911: invalid character
    SQL> create table "_t4"(id number);Table created.
      

  6.   

    这个是个bag,这样也可以 createtable "_t3" ("_Identify"number,"_Locked"number,"_SortKey"number);Table created.但是你select *from _t3是不存在该表的
      

  7.   


    这样可以吧:
    Select * From [_t3]
      

  8.   

    SQL> select * from "_t4";no rows selected加上引号啊