我通过其他工具导入到ORACLE中一张表 表名为1.3.11.12
表结构如下:
-- Create table
create table 1.3.11.12
(
CreateTime DATE not null,
RecordState VARCHAR2(10),
percentUsed FLOAT,
Mbfree FLOAT,
pagesPerSec FLOAT,
TotalMemory FLOAT
)
tablespace OADATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table 1.3.11.12
add primary key (CREATETIME)
using index
tablespace OADATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
问题是:我用sql语句查询表中任何一个字段都会报错
例如:select createtime from "1.3.11.12" 执行之后报错(invalid identifier)谁能帮忙解决下 谢谢
表结构如下:
-- Create table
create table 1.3.11.12
(
CreateTime DATE not null,
RecordState VARCHAR2(10),
percentUsed FLOAT,
Mbfree FLOAT,
pagesPerSec FLOAT,
TotalMemory FLOAT
)
tablespace OADATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table 1.3.11.12
add primary key (CREATETIME)
using index
tablespace OADATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
问题是:我用sql语句查询表中任何一个字段都会报错
例如:select createtime from "1.3.11.12" 执行之后报错(invalid identifier)谁能帮忙解决下 谢谢
不加引号试试
如果就执行“select * from 1.3.11.12”会报错(invalid table name )我加了引号后(select * from “1.3.11.12”)就可以执行了
但是select createtime from "1.3.11.12"就不行
SQL> SELECT * FROM SYS."1.3.11.12";
CREATETIME RECORDSTATE PERCENTUSED MBFREE PAGESPERSEC TOTALMEMORY
----------- ----------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Executed in 0.032 seconds
SQL> SELECT createtime FROM SYS."1.3.11.12";
CREATETIME
-----------
Executed in 0.031 seconds
SQL>
是CreateTime的大小写问题吧
select * from “1.3.11.12“