oracle-sqldeveloper - sqldeveloper 将整数插入导出为字符串
问题描述
这似乎是版本 19.4 中的一个错误,在 20+ 中已修复我在 sqldeveloper 中导出了我的表的内容,并且插入 sql 语句都将数字作为字符串。例子:
Insert into testtable(id,stuff) values ('1','Hello')
ID 1 在导出中变为“1”,我无法读取它。每个表都是这种情况。有没有办法避免这两个 ' ?
DDL 是:
create table TESTTABLE(
ID INTEGER not null
);
在 sqldeveloepr 中执行它之后:
create table testtable{
"ID" Number(*,0) NOT NULL ENABLE
}
我注意到如果约束不活跃,我可以添加这样的一行。似乎 sqldeveloper 在内部将字符串转换为数字。
解决方案
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);
数值/字段上没有引号。我使用 20.2 版的 SQL Developer 做到了这一点。
推荐阅读
- angular - 在 `formGroup` 中添加动态控件会自动按字母顺序排序
- python - 是否可以过滤推文,因为它们被twint或getoldtweets3中的转发或喜欢的数量刮掉?
- google-cloud-functions - 在 Google 的云函数上使用 Poppler(用于 pdf2image Python 库)
- python - 改进张量流中的异或神经网络并使用密集作为输入层
- postgresql - 带有 dockerized PostgreSQL 的 pg_restore 以分段错误结束
- enums - 如何结合枚举变量和值的测试?
- c - 指向结构指针的指针
- google-bigquery - 如何在 Google Bigquery 中将列名转换为全部大写?(SQL)(包括图像)
- r - 如何将分组值(每个主题)从一个 df 分配给另一个按试验分组的 df(例如,每个主题的重复行)
- typo3 - 如何访问 FLUIDTEMPLATE 文件中的数据并将该内容呈现在我们所需的文件中?