sqldeveloper 将整数插入导出为字符串
sqldeveloper exports integer inserts as strings
这似乎是版本 19.4 中的错误,已在 20+ 中修复
我在 sqldeveloper 中导出了我的 tables 的内容,并且插入 sql 语句都将数字作为字符串。
示例:
Insert into testtable(id,stuff) values ('1','Hello')
ID 1 在导出时变成“1”,我无法读入它。
每个 table 都是这种情况。有没有办法避免这两个 ' ?
DDL 是:
create table TESTTABLE(
ID INTEGER not null
);
在 sqldeveloepr 中执行它之后:
create table testtable{
"ID" Number(*,0) NOT NULL ENABLE
}
我注意到如果约束未激活,我可以添加这样一行。似乎 sql 开发人员在内部将字符串转换为数字。
create table testtable(
"ID" Number(*,0) NOT NULL ENABLE
);
insert into testtable values (1);
commit;
select /*insert*/ * from testtable;
运行这个,我明白了
Table TESTTABLE created.
1 row inserted.
Commit complete.
REM INSERTING into TESTTABLE
SET DEFINE OFF;
Insert into TESTTABLE (ID) values (1);
号码 value/field 没有引号。我使用 SQL Developer.
的 20.2 版完成了此操作
这似乎是版本 19.4 中的错误,已在 20+ 中修复 我在 sqldeveloper 中导出了我的 tables 的内容,并且插入 sql 语句都将数字作为字符串。 示例:
Insert into testtable(id,stuff) values ('1','Hello')
ID 1 在导出时变成“1”,我无法读入它。 每个 table 都是这种情况。有没有办法避免这两个 ' ?
DDL 是:
create table TESTTABLE(
ID INTEGER not null
);
在 sqldeveloepr 中执行它之后:
create table testtable{
"ID" Number(*,0) NOT NULL ENABLE
}
我注意到如果约束未激活,我可以添加这样一行。似乎 sql 开发人员在内部将字符串转换为数字。
create table testtable(
"ID" Number(*,0) NOT NULL ENABLE
);
insert into testtable values (1);
commit;
select /*insert*/ * from testtable;
运行这个,我明白了
Table TESTTABLE created.
1 row inserted.
Commit complete.
REM INSERTING into TESTTABLE
SET DEFINE OFF;
Insert into TESTTABLE (ID) values (1);
号码 value/field 没有引号。我使用 SQL Developer.
的 20.2 版完成了此操作