是否有 Oracle SQL 工具可以从结果集构建插入语句?
是否有 Oracle SQL 工具可以从结果集构建插入语句? 目前我们只能使用一个名为 SQL Station 的工具。 我想推荐一个工具,比如 Rapid SQL 或 CrazySQuirrell,或者构建我自己的可重复使用的 sql 块。
Is there an Oracle SQL tool that builds insert statements from a result set? We are currently only allowed to use a tool called SQL Station. I'd like to either suggest a tool, like Rapid SQL or CrazySQuirrell, or build my own re-usable chunk of sql.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
在紧要关头,使用字符串连接非常适合您想要构建的较小语句:
In a pinch, using string contatenation works great for smaller statements you want to build:
右键单击查询的结果集,您将弹出一个窗口。 选择导出数据并插入。 它会询问您生成插入语句的文件的保存位置。 给出文件名和保存路径。
Right click on the result set of the query, you will get a pop up. select export data and insert. it will ask you for the location to save the file in which insert statements are generated. give file name and the path to save it.
我知道为时已晚,但它可能对某人有帮助。
如果你去表里,你可以“导出”数据。 第二步是“指定数据”,您可以在其中添加一些过滤器。
这只适用于表数据。
干杯
I know it is too late but It could be helpfull for somebody.
If you go to the table, you can "export" the data. The second step is "Specify Data" where you can add some filters.
This only works for a table data.
Cheers
使用 Oracle SQL-Developer 输入并作为脚本执行 (F5):
输出:
您也可以尝试 /*csv*/" 或 /*html*/
源:http://www.thatjeffsmith.com/archive/2012/05/formatting-query-结果到 csv-in-oracle-sql-developer/
With Oracle SQL-Developer type and execute as script (F5):
output:
you can try also /*csv*/" or /*html*/
source: http://www.thatjeffsmith.com/archive/2012/05/formatting-query-results-to-csv-in-oracle-sql-developer/
这个结果集从哪里来? 如果您的意思是要执行 SELECT,然后将结果数据插入到另一个表中,您可以在单个 SQL 语句中执行此操作:
Where is this result set coming from? If you mean that you want to execute a SELECT, then insert the resulting data into another table, you can do that in a single SQL statement:
PL/SQL Developer 也将执行此操作。 我使用过 PL/SQL Developer 和 Oracle 的 SQL Developer,在我看来,PL/SQL Developer 具有更流畅、更一致的界面。 不确定 SQL Developer,但不确定 PL/SQL Dev。 还允许您将结果集导出为 CSV、XML 和 HTML。
如果您运行的是 Linux,它在 WINE 下也可以正常运行。
PL/SQL Developer will do this as well. I've used both PL/SQL Developer as well as Oracle's SQL Developer, and in my opinion PL/SQL Developer has a smoother and more consistent interface. Not sure about SQL Developer, but PL/SQL Dev. also lets you export result sets as CSV,XML, and HTML.
It also behaves OK under WINE if you're running Linux.
如果您需要命令行工具,免费的 cx_OracleTools 可以做到这一点,还有其他一些好东西。
http://cx-oracletools.sourceforge.net/
If you want command line tools, the free cx_OracleTools will do this, and some other nice things as well.
http://cx-oracletools.sourceforge.net/
是的,查看 Oracle sql Developer。可以从 otn.oracle.com 免费下载
Yes look at Oracle sql developer.Its free can be downloaded from otn.oracle.com
我找到了这个解决方案,这就是我现在正在使用的。 感谢您的所有帮助。
事实证明我们也可以使用 SQL+。 由于某种原因我无法在 SQL Station 中运行它。
从 userid/password@from_DB 复制到 userid/password>@to_DB INSERT toDB_tablename USING SELECT * FROM fromDB_tablename where ....;
犯罪;
I found this solution, which is what I'm using now. Thanks for all of the help.
It turns out we can use SQL+ too. For some reason I can't run it in SQL Station.
COPY FROM userid/password@from_DB TO userid/password>@to_DB INSERT toDB_tablename USING SELECT * FROM fromDB_tablename where ....;
commit;