SQL*PLUS HTML reports
Hi how to add javascripts to the HTML reports generated using SQL*plus :
SET MARKUP HTML ON SPOOL ON
If we want to modify the dynamically generated HTML page by SQL*PLUS how does one do that??
Please help
If you create a script containing the following it should work:
set markup html on spool on
spool <your file>
run sql-commands here
spool off
set markup html off
Similar Messages
-
SQL*Plus Sending Report to Printer
Hello:
I have a query which I would like to send the report to the printer. I am using the SPOOL OUT command and the report will not print. I'm running 10g.
Can someone help?
This is my SQL script:
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SPOOL C:\DEMO\DEPT3
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES
COLUMN DEPARTMENT_ID HEADING 'DEPT'
COLUMN LAST_NAME HEADING 'LAST NAME'
COLUMN SALARY HEADING 'SALARY' FORMAT $99,999
BREAK ON DEPARTMENT_ID SKIP 1 ON REPORT
COMPUTE SUM OF SALARY ON DEPARTMENT_ID
COMPUTE SUM OF SALARY ON REPORT
TTITLE CENTER 'iAPPLE PERSONNEL REPORT' SKIP 2 -
LEFT 'EMPLOYEE REPORT' RIGHT 'PAGE:' -
FORMAT 999 SQL.PNO SKIP 2
BTITLE 'COMPANY CONFIDENTIAL'
SELECT DEPARTMENT_ID, LAST_NAME, SALARY
FROM EMP_DETAILS_VIEW
WHERE SALARY > 12000;
SPOOL OUT
Thank you in advance.from the 9i documentation
Stops spooling and sends the file to your host computer's standard (default) printer. This option is not available on some operating systems.
the 10g doc does not contain the second sentence.
so, what's your os? do you have a default printer set up? what version of sqlplus (client, not database)? -
SQL*Plus report: hide accept value in report
HI all,
I have created an SQL Report of an APEX-Application. The output is stored in a HTML file.
All works fine but one think I want to hide in the HTML report.
I try to describe what the problem is.
I prompt the user to put in the application_id of the apex application:
accept v_application_Id char prompt 'Appliaction-ID:'
In the HTML file the following output is shown:
Report created on:
25-Jun-2013, 10:06:04
alt 8: where application_id = &&v_application_id
neu 8: where application_id = 680
Workspace
WORKSPACE
APPLICATION_ID
APPLICATION_NAME
ALIAS
OWNER
Q0Q0AUFTRAGSVERWALTUNG
680
Q0Q0AUFTRAGSVERWALTUNG
F680317
Q0Q0AUFTRAGSVERWALTUNG_ADMIN
How can I hide the two lines
alt 8: where application_id = &&v_application_id
neu 8: where application_id = 680
from the report?
I have searched this forum and toke a look into the documentation but I have nothing found.
Could anyone please help me?
Oracle 11g R2
This is the SQL script what I run in SQL*Plus.
-- start script
accept v_application_Id char prompt 'Appliaction-ID:'
spool C:\a\APEX.html
set termout off
SET MARKUP HTML ON SPOOL ON HEAD "<TITLE>SQL*Plus APEX-Report</title> -
<STYLE TYPE=’TEXT/CSS’><!--BODY {bgcolor: ffffaa background: ffffc6} --></STYLE>"
clear break
clear buffer
clear compute
clear column
clear sql
set feedback off
set serveroutput on
-- Report Header
ttitle left ' ' skip 1
select TO_CHAR(sysdate,'dd-Mon-yyyy, hh24:mm:ss') "Report created on:"
from dual;
-- Workspace
ttitle left col 15 '<font face="Arial" size="+2" color="#0000FF">Workspace</font>' skip 1
set linesize 300
set pagesize 500
set serveroutput on
column workspace format a35
column application_id format 99999999
column application_name format a35
column alias format a35
column owner format a35
select
WORKSPACE,
APPLICATION_ID ,
APPLICATION_NAME,
ALIAS,
OWNER
from apex_applications
where application_id = &&v_application_id;
ttitle off
select
APPLICATION_GROUP,
APPLICATION_GROUP_ID,
HOME_LINK,
PAGE_TEMPLATE,
ERROR_PAGE_TEMPLATE
from apex_applications
where application_id = &&v_application_id;
set termout on
set markup html off head '' body '' entmap off spool off pre off
set feedback on
set linesize 80
set pagesize 50
ttitle off
set termout on
set serveroutput off
spool off
set echo on
-- End Script
best regards
ben
Oracle 11g R2Hi, Ben,
The SQL*Plus command to stop those messages is
SET VERIFY OFF
Put this command anywhere before the first use of a substitution variable, e.g. before the SPOOL command.
Those "OLD" and "NEW" messages will stay suppressed until you either end the SQL*Plus session, or issue a SET VERIFY ON command.
If you use SQL*Plus often, then, when you have a few minutes, look up the SET command in the SQL*Plus manual,
SET System Variable Summary
and read a little about each option. You probably won't remember everything, but you probably will remember what kinds of things can be controlled by the SET command, and have a better idea of where to start looking in the future when you have a different problem. -
Can we use xml Publisher reporting for sql* Plus in EBS
Hello All,
The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format.
So is it possible to use the xml reporting and make the output as Excel from the word template we design from MSword as we do for rdf(I have done few reports created in rdf to xml publisher reports in EBS and stand alone as well.).
Do the same procedure will suit for Sql*Plus reports tooo or Is there any work around to achieve this.
Thanks and Regards
Balaji.Hi
Thanks for the reply..
I tried to do the follwoing
1. changed the output to xml in the conc. prog.
2. ran the same report but i am getting the follwoing error in the output file
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource
Other reports which are using the Oracle Reports(rdf) as source, i am able to generated the xml as expected....
So my question is whether we can use sql* reports executable and generate xml in the conc.prog.
if any one has used the sql*reports for xml publisher reporting... please let me know, so that if its possible i will check my sql needs some validation or tuning...
thanks in advance
Balaji. -
Inserting digitized signature in SQL plus reports
Our company has decided to use SQL plus for reporting needs. We have few reports with digitized signature printed at the bottom. Is this possible in SQL plus. Digitized signature should be in which format? Can somebody help me. If SQL plus doesn't support this, we mat need to look for alternate tools for reports.
Actually, it looks like Forums do something strange to URLs pasted into posts. Sorry!
The thread URL is Re: store/retrieve data in lang other than eng when CHARACTERSET is not UTF8 -
Print a report from sql*plus.
Regards all
Let me know whether it is possible to print a hard report rom sql*plus and how.
waitingLet me know whether it is possible to print a hard report rom sql*plus Yes. SPOOL is a command to get SQL*Plus screen results to disk real-time.
and how.A "report" is such a generic term, that you will have to get started with at least some reading :)
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a90842/toc.htm
(search for: "How Can I Learn SQL*Plus")
You may also address specific questions about the SQL*Plus product (that are not really Database SQL and/or PL/SQL related) via the [Technologies>Tools>iSQL*Plus] forum rather than here.
waiting That's up to you! Dig in!
Michael O'Neill
Publisher of the PigiWiki
clever-idea.com -
SQL Plus command to print a report in Landscape format
Hi,
what is the SQL Plus command to print a report in Landscape format?841731 wrote:
Hi,
what is the SQL Plus command to print a report in Landscape format?SQLPlus doesn't print, and it doesn't know about 'landscape' vs. 'portrait' any more than it knows about fonts. the only 'formatting' it knows is line size, page size. And all it does with line size is know where to insert a CR/LF pair (windows) or a CR (*nix). The only thing it knows to do with page size is repeat column headers.
The rest is up to whatever application you use to open the pure asciii text spool file. -
Errors while submitting the SQL * Plus Report
I am getting th efollowing Error while submitting the Concurrent request to run a report.
FND_CANNOT FIND FILE
concurrent manager encountered an error while running sql * plus for yours concurrent request
Please respond ASAPHi,
Duplicate post see:
Please advise on the Error immediately
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/ -
Generating an html report based on table at sql 2005 db
Hi
I want to create an html report based on a table named inventory on sql server 2005 database.
first code used to generate an output report
try {
// TODO add your handling code here:
String s = "<html> <body> <table border=1><caption> Inventory Report </caption>";
s += "<tr><td>Item_id<td>item_name<td>Existing quantity</td><tr><td>3<td>4<td> <td>";
byte[] sb = s.getBytes();
FileOutputStream fs = null;
try {
fs = new FileOutputStream("D:\\Report\\Report.html");
} catch (FileNotFoundException ex) {
Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
fs.write(sb);
fs.close();
} catch (IOException ex) {
Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
Second jdbc code for connection and select all records in the table
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
st = con.createStatement( );
ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity from Inventory");
String s="";
while(rset.next())
s+=(rset.getString(1)+"\t\t"+rset.getString(2)+"\t"+rset.getString(3)+"\t"+rset.getString(4)+"\n");
st.close();
con.close();
catch(ClassNotFoundException ex)
ex.printStackTrace();
catch(SQLException ex)
ex.printStackTrace();
} I want someone helps me to merge two codes into one code to generate an output html report.
thanks in advanceThis is my trial but not the desired result ,it's displayed the title and a line only
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String s = "<html> <body> <table border=1> <caption>Report title</caption>";
byte[] sb = s.getBytes();
FileOutputStream fs = null;
try {
// TODO add your handling code here:
try {
fs = new FileOutputStream("D:\\Report\\myeport.html");
} catch (FileNotFoundException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
fs.write(sb);
fs.close();
} catch (IOException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
st = con.createStatement( );
ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity from Inventory");
while(rset.next())
s+=("<tr><td>"+rset.getString("Item_Code")+"</td><td>"+rset.getString("Item_Name")+"</td><td>"+rset.getString("item_cost")+"</td><td>"+rset.getString("item_quantity")+"</td></tr>");
try {
// TODO add your handling code here:
try {
fs = new FileOutputStream("D:\\Report\\myeport.html");
} catch (FileNotFoundException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
fs.write(sb);
fs.close();
} catch (IOException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
st.close();
con.close();
catch(ClassNotFoundException ex)
ex.printStackTrace();
catch(SQLException ex)
ex.printStackTrace();
} -
Using Bind variables in SQL PLUS Report
using Bind variables in SQL PLUS Report. This report gets the arguments from the application concurrent program. Now my need is to convert the start_date and end_date to bind Variables to improve the performance. I have commented the original code in 'prompt List of Unapproved Adjustments' and used my Bind Variable but it is giving an error
error: Bind Variable "ENDING_DATE" not declared
Report Date and Time:
26-OCT-2010 15:44:13
List of Unapproved Adjustments
Bind Variable 'ENDING_DATE" not declared
Please see below the code for the sql plus report:
define p_org_id = '&1'
define p_fy_begin_date = '&2'
define p_start_date = '&3'
define p_end_date = '&4'
define p_conversion = '&5'
declare
variable begin_date date;
exec :begin_date := p_start_date;
variable ending_date date;
exec :ending_date := p_end_date;
/* Begin
:begin_date := to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS');
:ending_date := to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS');
End; */
set newpage none
set termout off
set pagesize 55
set linesize 180
set heading on
set feedback off
set wrap off
set space 1
set heading on
begin
dbms_application_info.set_client_info('&p_org_id');
end;
prompt
prompt Report Date and Time:
prompt ----------------------
select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')
from dual ;
prompt
prompt List of Unapproved Adjustments
prompt -------------------------------
select b.trx_number,
a.adjustment_number,
f.user_name created_by
from apps.ar_adjustments a,
apps.ra_customer_trx b,
apps.fnd_user f
where a.customer_trx_id = b.customer_trx_id
and a.status <> 'A'
and a.created_by = f.user_id
and a.creation_date between :begin_date
and :ending_date
-- and a.creation_Date between to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS')
-- and to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS')
order by
b.trx_number ;Hi
Please go to customization part of the report and verify..You have set a default value out there ..And also verify your lov and look at the values ..If it is again giving you the problem ..pl delete the report and develop it again from the scratch it will be solved...
vishnu
null -
Signal 11 error in SQL Plus report
Hi,
While running the sql plus type of report in oracle apps environment, i'm getting below error in the log after generating half of the o/p.
stat_low = 8B
stat_high = 0
emsg:was terminated by signal 11
Please help if anyone have idea on this.
Thanks in advance,
Devaraj.KPlease post the details of the application release, database version and OS.
While running the sql plus type of report in oracle apps environment, i'm getting below error in the log after generating half of the o/p.
stat_low = 8B
stat_high = 0
emsg:was terminated by signal 11
Please help if anyone have idea on this.Is this a custom or seeded concurrent program?
Please post the contents of the concurrent request log file here.
https://forums.oracle.com/forums/search.jspa?threadID=&q=Signal+AND+11&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Hi,
There is an SQL Plus REport which was developed by someone else a couple of years ago. And now i pulled the code to make a few changes in the columns and put it back.
Before i made the change i ran the report from the Oracle applications and there was no error.
But for some reason when i changed it and ran it from applications, there is an error that shows up:
EXEC FND_CONC_STAT.COLLECT
ERROR at line 163:
ORA-00933: SQL command not properly ended
And so i reverted back to the original code and the same error shows up.
Can someone tell me why this is error is showing up?
This is the sql code for the report:
SET ECHO OFF
SET SHOW OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET PAGESIZE 0
SET LINESIZE 450
--WHENEVER SQLERROR EXIT;
DEFINE vfrmdte = '&&1';
DEFINE vtodte = '&&2';
DEFINE vjobnum = '&&3';
DEFINE vorgid = '&&4';
select substr(we.wip_entity_name,1,10)||';'||
substr(msi.segment1,1,10)||';'||
rc.customer_number||';'||
rsu.location||';'||
substr(sl.cust_po_number,1,25)||';'|| --changed sh to sl
--sh.ordered_date||';'||
sl.creation_date||';'||----extra colmn added
sl.ordered_item||';'|| substr(sl.attribute8,1,30)||';'||
REPLACE(sl.ordered_item,'?',' ')||';'|| --substr(sl.attribute8,1,30)||';'||
sl.request_date||';'||
substr(dcgv.segment2,1,15)||';'||
substr(dgv.SEGMENT1,1,20)||';'||
sh.order_number||';'||
substr(dcgv.segment3,1,15)||';'||
substr(dcgv.segment4,1,25)||';'||
substr(dscv.segment2,1,20)||';'||
substr(dscv.segment3,1,10)||';'||
wdj.start_quantity||';'||
wdj.quantity_completed||';'||
sl.order_quantity_uom||';'||
wdj.completion_subinventory||';'||
wdj.completion_locator_id||';'||
wdj.primary_item_id||';'||
wdj.wip_entity_id||';'||
wdj.scheduled_start_date||';'||
wdj.status_type||';'||
substr(ml.meaning,1,30)||';'||
ml.lookup_code||';'||
md.demand_source_header_id||';'||
substr(md.demand_source_line,1,15)||';'||
mso.sales_order_id||';'||
substr(mso.segment1,1,15)||';'||
substr(mso.segment2,1,25)||';'||
substr(mso.segment3,1,20)||';'||
mic.category_set_id||';'||
mic2.category_set_id||';'||
dgv.category_id||';'||
dcgv.category_id||';'||
sh.header_id||';'||
sh.order_type_id||';'||
sl.line_number||';'||
sl.line_id||';'||
sl.inventory_item_id||';'||
substr(sl.attribute11,1,20)||';'||
msi.fixed_lot_multiplier||';'||
substr(dscv.segment1,1,20)||';'||
wdj.organization_id||';'||
rc.customer_id||';'||
rsu.site_use_id||';'||
sl.LAST_UPDATE_DATE------extra colmn added
from
apps.wip_entities we ,
apps.wip_discrete_jobs wdj ,
apps.mfg_lookups ml ,
--apps.wip_so_allocations wsa ,
apps.mtl_demand md, --inv.mtl_demand md ,
apps.mtl_sales_orders mso ,
apps.mtl_system_items_b msi,--inv.mtl_system_items_b msi ,
apps.mtl_item_categories mic ,
apps.mtl_item_categories mic2 ,
apps.mtl_item_categories mic3 ,
apps.mtl_category_sets mcs ,
apps.mtl_category_sets mcs2 ,
apps.mtl_category_sets mcs3 ,
apps.MTL_CATEGORIES_B dgv,--INV.MTL_CATEGORIES_B dgv ,
apps.MTL_CATEGORIES_B dcgv ,
apps.MTL_CATEGORIES_B dscv ,
apps.oe_order_headers_all sh, --so_headers_all sh ,
apps.oe_order_lines_all sl, --so_lines_all sl ,
apps.oe_transaction_types_tl sot, --so_order_types_all sot ,
apps.ra_customers rc ,
apps.ra_site_uses_all rsu
where
we.wip_entity_id = wdj.wip_entity_id
and wdj.firm_planned_flag in (1,2)
and wdj.status_type = ml.lookup_code
and ml.lookup_type = 'WIP_JOB_STATUS'
and md.supply_source_header_id = we.wip_entity_id
-- and sh.header_id = mso.sales_order_id
and mso.segment1 = sh.order_number
and mso.segment2 = sot.name
and sot.transaction_type_id = sh.order_type_id
and sh.sold_to_org_id = rc.customer_id
and sh.ship_to_org_id = rsu.site_use_id
--DUPLICATE and sh.order_type_id = sot.order_type_id
and sl.header_id = sh.header_id
and sl.line_id = md.demand_source_line
and sl.inventory_item_id = msi.inventory_item_id
and msi.organization_id = wdj.organization_id
and msi.inventory_item_id = mic.inventory_item_id
and msi.organization_id = mic.organization_id
and mic.category_set_id = mcs.category_set_id
and mcs.category_set_name = 'DWC Groups'
and dgv.category_id = mic.category_id
AND dgv.STRUCTURE_ID = 50109
and msi.inventory_item_id = mic2.inventory_item_id
and msi.organization_id = mic2.organization_id
and mic2.category_set_id = mcs2.category_set_id
and mcs2.category_set_name = 'DWC COLORS'
and dcgv.category_id = mic2.category_id
AND dcgv.STRUCTURE_ID = 50111
and msi.inventory_item_id = mic3.inventory_item_id
and msi.organization_id = mic3.organization_id
and mic3.category_set_id = mcs3.category_set_id
and mcs3.category_set_name = 'DWC Ship'
and dscv.category_id = mic3.category_id
AND dscv.STRUCTURE_ID = 50112
AND to_date(to_char(sl.request_date,'DD-MON-YYYY'),'DD-MON-YYYY') between
nvl(to_date(to_char('&vfrmdte','DD-MON-YYYY'),'DD-MON-YYYY'),sl.request_date)
and nvl(to_date(to_char('&vtodte' ,'DD-MON-YYYY'),'DD-MON-YYYY'),sl.request_date)
AND we.wip_entity_name = NVL('&vjobnum', we.wip_entity_name)
AND we.organization_id = NVL('&&4',we.organization_id)
AND wdj.status_type IN (1,3)
GROUP BY
substr(we.wip_entity_name,1,10)||';'||
substr(msi.segment1,1,10)||';'||
rc.customer_number||';'||
rsu.location||';'||
substr(sl.cust_po_number,1,25)||';'|| --changed from sh to sl
--sh.ordered_date||';'||
sl.creation_date||';'||
sl.ordered_item||';'|| substr(sl.attribute8,1,30)||';'||
REPLACE(sl.ordered_item,'?',' ')||';'|| --substr(sl.attribute8,1,30)||';'||
sl.request_date||';'||
substr(dcgv.segment2,1,15)||';'||
substr(dgv.SEGMENT1,1,20)||';'||
sh.order_number||';'||
substr(dcgv.segment3,1,15)||';'||
substr(dcgv.segment4,1,25)||';'||
substr(dscv.segment2,1,20)||';'||
substr(dscv.segment3,1,10)||';'||
wdj.start_quantity||';'||
wdj.quantity_completed||';'||
sl.order_quantity_uom||';'||
wdj.completion_subinventory||';'||
wdj.completion_locator_id||';'||
wdj.primary_item_id||';'||
wdj.wip_entity_id||';'||
wdj.scheduled_start_date||';'||
wdj.status_type||';'||
substr(ml.meaning,1,30)||';'||
ml.lookup_code||';'||
md.demand_source_header_id||';'||
substr(md.demand_source_line,1,15)||';'||
mso.sales_order_id||';'||
substr(mso.segment1,1,15)||';'||
substr(mso.segment2,1,25)||';'||
substr(mso.segment3,1,20)||';'||
mic.category_set_id||';'||
mic2.category_set_id||';'||
dgv.category_id||';'||
dcgv.category_id||';'||
sh.header_id||';'||
sh.order_type_id||';'||
sl.line_number||';'||
sl.line_id||';'||
sl.inventory_item_id||';'||
substr(sl.attribute11,1,20)||';'||
msi.fixed_lot_multiplier||';'||
substr(dscv.segment1,1,20)||';'||
wdj.organization_id||';'||
rc.customer_id||';'||
rsu.site_use_id||';'||
sl.LAST_UPDATE_DATE ----extra colmn addedThen we reverted back to the original and there it was the same error.This doesn't seem possible to me. Maybe you just didn't use the exact original script. Other Charset, other linebreaks, UNIX2DOS conversion, etc.
So debugging the error seems useful to me. At least you got an error message and could start working up on that.
On the other hand maybe it would be better to ask this question in the Applications Forum. I think this is this one: Business Intelligence Applications
Regards
Sven -
How to convert SQL*Plus reports to SQLDeveloper?
Hello,
I installed Oracle 11g and found that SQLPLUSW.EXE was not there.
I have many scripts, reports, developed in SQLPLUS.
How can I convert my reports to run in SQL Developer and produce the same nice output?
It seems that SQLDev does not support columns formatting, TTITLE, BTITLE, BREAK, all the nice SQLPLUS stuff.
Any ideas other than installing Oracle10g and running good old SQLPLUS?
Thank you,
YGHi YG,
Based on your comments, you have either experimented a bit or read some forum posts like these:
Re: sqlplusw.exe not found
SQLPLUS commands in SQL Developer
Perhaps you could use the command line version of SQL*Plus (sqlplus.exe) which is still available in 11g and just spool the output?
Regards,
Gary Graham
SQLDeveloper Team -
Hwo to create a matrix report in sql Plus
i want to create matrix report in SQL plus for emp table. how is it possible
requirement is as following
Deptno -- Clerk -- Salesman--Manager
10----------2500---3500--------4500
20----------2400---3400--------4400
30----------1400---4400--------5400Hi,
Do a search on this site on
-'pivot'
and/or:
-'stragg'
and/or:
-'columns to rows'
to get many example that will give you ideas.
Also you forgot to mention this:
What's the value of the job titles?
Sum of salary of....?
edit
Using my data:
MHO%xe> select deptno, job, sal from emp order by deptno
2 /
DEPTNO JOB SAL
10 MANAGER 2450
10 PRESIDENT 5000
10 CLERK 1300
20 ANALYST 3000
20 CLERK 800
20 CLERK 1100
20 ANALYST 3000
20 MANAGER 2975
30 MANAGER 2850
30 SALESMAN 1600
30 CLERK 950
30 SALESMAN 1250
30 SALESMAN 1500
30 SALESMAN 1250
14 rijen zijn geselecteerd.I would get:
MHO%xe> select deptno
2 , sum(decode(job,'CLERK',sal,0)) CLERK
3 , sum(decode(job,'SALESMAN',sal,0)) SALESMAN
4 , sum(decode(job,'MANAGER',sal,0)) MANAGER
5 from emp
6 group by deptno
7 order by deptno
8 /
DEPTNO CLERK SALESMAN MANAGER
10 1300 0 2450
20 1900 0 2975
30 950 5600 2850Edited by: hoek on Oct 17, 2009 3:19 PM -
I'd like users to run the SQL reports from a desktop icon. Someone suggested a .bat file but I'm not sure how to do this. Can you provide more details?
Thanks,
DaneI'd like users to run the SQL reports from a desktop icon. Someone suggested a .bat file but I'm not sure how to do this. Can you provide more details?Dane,
Here's a simple .bat and .sql file to get you started:
RUNSCRIPT.BAT
sqlplus scott/tiger@ora901 @c:\temp\script.sql
notepad.exe c:\temp\output.txt
SCRIPT.SQL
set linesize 200
spool c:\temp\output.txt
select * from emp;
spool off
exit
If you are using SQL*Plus 9.0.1 for Windows, you can also store the script on a web server and run it from a URL, eg,
sqlplus scott/tiger@ora901 @http://mymachine.com/scripts/script.sql
This feature will be available on all platforms in future releases.
Alison
Maybe you are looking for
-
I have an Olymput E620 and iPad 4th generation, how can I download the pictures off the camera to the iPad? The only cable I can find with lightning and usb is the apple camera adaptor but it is £25 from Apple which is a bit expensive if it will not
-
Serial number Air not accepted during registration AppleCare
Not sure if this is the right place for this. I just bought my MacBook ait today, including an applecare protectionplan. While registrating, AppleCare doen't seem to want to accept my serial number. I'm pretty sure I entered the right number, several
-
How to Superimpose Video without adjusting Opacity?
Hi guys, so I am really new to adobe premiere elements..and video editing in general. What I want to do is superimpose two videos on each other so that it looks as if were happening at the same time. For an example, I don't know if any of you have wa
-
JDeveloper doesn't load browser for servlets
I have JDeveloper 3.1.1.2 and am trying to use it to run servlets under Win98. The problem is that when it runs a servlet, it doesn't load my web browser, IE 5.0. The IDE recognizes the servlets for what they are and lets me register them with the We
-
TS1424 Downloaded a song that won't play
I've downloaded 20 songs in one day. 5 of the songs will only play for 20 seconds before there is either silence or it automatically goes on to the next song. What is goin on?!!