当我尝试创建表时,它失败并显示ORA-00904: : invalid identifier
。这是我的桌子。
create table eas_citizen_text_info (
UID bigint(12) Primary key,
Gender char(15),
First_name varchar(30),
Middle_name varchar(30),
Last_name varchar(30),
DOB date Not null,
Age int(3),
Caste varchar(30),
Martial_status varchar(15),
Address varchar(255),
House_No_Bldg_Apt varchar(75),
Street_Road_Lane varchar(75),
Landmark varchar(75),
Area_locality_sector varchar(75),
Village_Town_City varchar(75),
Post_office varchar(75),
District varchar(25),
Sub_district varchar(25),
Pincode int(15),
State varchar(30),
Father_name varchar(200),
Mother_name varchar(200),
Guardian_name varchar(200)
);
答案 0 :(得分:2)
使用Oracle的数据类型。定义具有0
精度的数字列以使它们成为整数。使用varchar2
而不是varchar
(尽管Oracle会为您更改)。
create table eas_citizen_text_info (
UID number(12,0) not null Primary key,
Gender varchar2(15),
First_name varchar2(30),
Middle_name varchar2(30),
Last_name varchar2(30),
DOB date Not null,
Age number(3,0),
Caste varchar2(30),
Martial_status varchar2(15),
Address varchar2(255),
House_No_Bldg_Apt varchar2(75),
Street_Road_Lane varchar2(75),
Landmark varchar2(75),
Area_locality_sector varchar2(75),
Village_Town_City varchar2(75),
Post_office varchar2(75),
District varchar2(25),
Sub_district varchar2(25),
Pincode number(15,0),
State varchar2(30),
Father_name varchar2(200),
Mother_name varchar2(200),
Guardian_name varchar2(200)
);
但是我们仍然会收到错误:
UID number(12,0) not null Primary key,
*
ERROR at line 2:
ORA-00904: : invalid identifier
SQL>
但是Oracle已经足够慷慨地指出哪个列是导致错误的原因。如果我们检查文档,我们会在SQL保留关键字列表中找到UID
。 Find that here
解决方案很简单:将UID
更改为安全的内容,例如CITIZEN_UID
,可以创建表格:
SQL> create table eas_citizen_text_info (
2 citizen_UID number(12,0) not null Primary key,
3 Gender varchar2(15),
4 First_name varchar2(30),
5 Middle_name varchar2(30),
6 Last_name varchar2(30),
7 DOB date Not null,
8 Age number(3,0),
9 Caste varchar2(30),
10 Martial_status varchar2(15),
11 Address varchar2(255),
12 House_No_Bldg_Apt varchar2(75),
13 Street_Road_Lane varchar2(75),
14 Landmark varchar2(75),
15 Area_locality_sector varchar2(75),
16 Village_Town_City varchar2(75),
17 Post_office varchar2(75),
18 District varchar2(25),
19 Sub_district varchar2(25),
20 Pincode number(15,0),
21 State varchar2(30),
22 Father_name varchar2(200),
23 Mother_name varchar2(200),
24 Guardian_name varchar2(200)
25 );
Table created.
SQL>
答案 1 :(得分:0)
Oracle,SQL Server,MySQL等数据库语言不支持大于12位的整数长度以及大整数。所以你改变了你的查询:
import { channel } from 'redux-saga'
import { select } from 'redux-saga/effects'
const socketChannel = channel()
function subscribe(socket) {
return eventChannel(emit => {
socket.on('reconnection', () => {
socketChannel.put({ type: RECONNECTION })
})
})
}
export function* watchSocketChannel() {
while (true) {
const action = yield take(socketChannel)
if (action.type === RECONNECTION) {
const lastMessageTimestamp = yield select(selectors.getLastMessageTimestamp)
...
}
}
}
答案 2 :(得分:0)
您的第一列声明中出现错误' UID bigint(12)主键' 。使用号码'而不是' bigint' as UID号码(12)主键 请参阅此图片以供参考[它一定会对您有帮助。[] [1]] [1]