在Oracle 11g中使用spool do do not of ot of ot ocy queries的结果

发布于 2025-01-30 16:16:57 字数 757 浏览 2 评论 0原文

我正在执行以下查询以进行分配,其中我需要使用Spool将某些表的内容输出到文件。当我运行它时,仅将语句写入文件而不是结果。我已经搜索了堆栈溢出和Oracle数据库,以找出原因并无处可去。

其他具有相同任务的人没有遇到这个问题。该服务器位于为我们提供给我们的VM内部,因此它们都相同。

我想念明显的东西吗?当在这种环境上展示了线轴时,它可以正常工作。另外,只是一个旁注,我无法将附录关键字与Spool一起使用,因为它会给我一个错误消息,即无法创建文件,或者该文件将命名为:'content.lst append'。我不尝试报价,单语引号和双引号。

这是我的sql文件的内容:

SPOOL "C:\content.lst";
SELECT * FROM client;
SELECT * FROM produit;
SELECT * FROM employe;
SELECT * FROM vente;
SELECT * FROM vente_produit;
SPOOL OFF;

content.lst文件中的输出是:

spool“ c:\ content.lst”;
从客户端选择 *;
选择 *从produit;
从雇员中选择 *;
从Vente;
选择 * 从vente_produit;
选择 * 启动;

如何获得选定语句的结果要显示在文件中?他们确实返回数据,SQL开发人员打开结果选项卡,数据很好。

感谢您指出我的方向正确。

I am executing the following query for an assignment where I need to output the content of some tables to a file using SPOOL. When I run it, only the statements are written to the file and not the results. I've searched Stack Overflow and the Oracle Database to find out why and got nowhere.

Other people with the same assignment aren't getting this problem. The server is inside a VM that is given to us for the assignment so they are all setup the same.

Am I missing something obvious? When SPOOL was showcased on this environment it worked properly. Also, just a side note, I cannot use the APPEND keyword with SPOOL because it will either give me an error message that the file can't be created or the file will be named: 'content.lst APPEND'. I tried no quotes, single quotes and double quotes.

Here is the content of my SQL file:

SPOOL "C:\content.lst";
SELECT * FROM client;
SELECT * FROM produit;
SELECT * FROM employe;
SELECT * FROM vente;
SELECT * FROM vente_produit;
SPOOL OFF;

The output inside the content.lst file is:

SPOOL "C:\content.lst";
SELECT * FROM client;
SELECT * FROM produit;
SELECT * FROM employe;
SELECT * FROM vente;
SELECT * FROM vente_produit;
SPOOL OFF;

How do I get the result of the SELECT statements to show up in the file? They do return data, SQL Developer open tabs of the results and the data is good.

Thank you for pointing me in the right direction.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

能否归途做我良人 2025-02-06 16:16:57

请确保将语句作为脚本(使用运行脚本F5)按钮运行,而不是常规命令执行。

Please make sure you run your statements as a script (using the Run Script F5) button and not as a regular command execution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文