Oracle 11g 报告问题

发布于 2024-10-22 01:33:07 字数 862 浏览 26 评论 0原文

嘿朋友们,我正在使用 Oracle 11G。我想生成用于打印的报告,所以我编写了这个脚本,

rem Employee Salary Report

set headsep !

ttitle 'Salary Report'
btitle 'From Employees'

column employee_id format 999.99
column first_name format a20
column last_name format a20
column Salary format 999.99

break on employee_id skip 1 on report

set linesize 80
set pagesize 5
set newpage 0
set feedback off

set pause 'More...'
set pause on

spool activity.lst

select employee_id,first_name,last_name,salary from Employees order by  employee_id ;

spool off

当运行这个脚本时,oracle 给出

line 3: SQLPLUS Command Skipped: set headsep !
line 15: SQLPLUS Command Skipped: set linesize 80
line 16: SQLPLUS Command Skipped: set pagesize 5
line 17: SQLPLUS Command Skipped: set newpage 0

,然后它执行查询并给出输出。但我的报告中不包含任何标题。这意味着报告未正确生成。它只是简单地执行选择查询并给出一个不是报告的输出。

Hey friends i am using Oracle 11G. I wanted to generate reports for printing , SO i write this script

rem Employee Salary Report

set headsep !

ttitle 'Salary Report'
btitle 'From Employees'

column employee_id format 999.99
column first_name format a20
column last_name format a20
column Salary format 999.99

break on employee_id skip 1 on report

set linesize 80
set pagesize 5
set newpage 0
set feedback off

set pause 'More...'
set pause on

spool activity.lst

select employee_id,first_name,last_name,salary from Employees order by  employee_id ;

spool off

When running this script oracle gives

line 3: SQLPLUS Command Skipped: set headsep !
line 15: SQLPLUS Command Skipped: set linesize 80
line 16: SQLPLUS Command Skipped: set pagesize 5
line 17: SQLPLUS Command Skipped: set newpage 0

and then it executes query and gives output. But my report doesn't include any title in it.Means reports is not generated properly. It just simply executes the select query and gives an output which is not a report.

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

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

发布评论

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

评论(1

抽个烟儿 2024-10-29 01:33:07

你有问题吗?

如果您的脚本是从 Oracle SQL Developer 中的 SQL 工作表运行的话,您向我们展示的内容看起来非常类似于我们期望的输出。

那些被跳过的命令特定于 SQL*Plus,并且在 SQL Developer 中不受支持(至少在我运行的版本中)。

要获得由 SQL*Plus 生成的格式化报告,我将从操作系统运行 sqlplus 可执行文件,例如

> $ORACLE_HOME/bin/sqlplus /
SQL> @/home/spencer7593/myreport.sql
SQL> exit
>

我不确定这是否回答了问题,因为我不知道您的问题是什么。

Did you have a question?

What you show us looks very much like the output we would expect if your script was run from the SQL Worksheet in Oracle SQL Developer.

Those commands that are being skipped are specific to SQL*Plus, and are not supported in SQL Developer (at least, in the version I'm running).

To get a formatted report produced by SQL*Plus, I would run the sqlplus executable from the OS e.g.

> $ORACLE_HOME/bin/sqlplus /
SQL> @/home/spencer7593/myreport.sql
SQL> exit
>

I'm not sure that answers a question, since I don't know what your question was.

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