SQL * Plus Reports
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,
Dane
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?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
Similar Messages
-
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 -
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 -
Automate SQL*Plus Report?
Can SQL*Plus reports be automated to run at certain days/times?
Thxcall sqlreport in .ksh file then put ksh file in jobfile as follows.
0 1 * * 1-5 sqlrep.ksh
crontab jobfile
now crontab run jobfile job every Monday-Friday at 1am. -
SQL*Plus report and R11 AOL
I have a sqlplus report that I want to invoke from the AOL. I registered the executable, defined the program, added the report to a request group. The report takes 2 parameters.
However I can not get it to work. Has anybody an example on how to register a SQL*plus report in the Oracle Applications R11?
DirkGeef me een belletje, los ik direkt voor je op.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Dirk van Vreeswijk ([email protected]):
I have a sqlplus report that I want to invoke from the AOL. I registered the executable, defined the program, added the report to a request group. The report takes 2 parameters.
However I can not get it to work. Has anybody an example on how to register a SQL*plus report in the Oracle Applications R11?
Dirk<HR></BLOCKQUOTE>
null -
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/ -
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 -
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 -
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. -
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 -
SQL*Plus report running through concurrent managers
I Created a report in sql*plus from a view table and running it through the concurrent manager in 11.5.10.2. I'm using 4 paramaters, but I made the awards paramaters as required parameters and the from and to creation dates as not required. However, I noticed when trying to run the report with just the awards numbers no data is populated, but when i run the report with awards and dates then the reports shows data. Is there a way to get this report to run with awards only and make dates as an option from the query below?
parameters#
##1 from award number
##2 to award number
##3 from creation date
##4 to creation date
set termout off
set head off
set pages 0
set feedback off
set verify off
set define #
col sort_col noprint
SELECT 'Revenue Report for Date ##3 - ##4, Awards ##1 - ##2', 0 sort_col
FROM DUAL
UNION
SELECT 'AWARD NUMBER^EVENT DATE^DESCRIPTION^REVENUE AMOUNT^CREATION DATE',
1
FROM DUAL
UNION
SELECT project_number
|| '^'
|| event_date
|| '^'
|| description
|| '^'
|| revenue_amount
|| '^'
|| creation_date,
2
FROM apps.pa_events_v
WHERE project_number BETWEEN NVL ('##1', project_number)
AND NVL ('##2', project_number)
AND creation_date BETWEEN TO_DATE (SUBSTR ('##3', 1, 10), 'YYYY/MM/DD')
AND TO_DATE (SUBSTR ('##4', 1, 10), 'YYYY/MM/DD')
ORDER BY 2;
ThanksHi;
Please see below note which could be helpful for your issue:
Unconstrained Msonwa64 Memory Based Planner 64 bit AIX Errors Signal 9 [ID 1274606.1]
JTM Master Program Failing With ORA-1403 on afpgrs [ID 752065.1]
Regard
Helios -
Hi,
I want to spool the results of a query to a file in Sql*Plus. The only problem I have with this is that Sql*plus is adding a blank line at the end of the file. This file is being used as input to another process and the blank line is causing problems for the process.
Is there any way of stopping the blank line from being added?
Thanks,
Niamhhi,the SET TRIMSPOOL command is there to remove the extra blanks in the generated output .see whether it helps.
mayuri -
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. -
Spacing between columns in SQL*Plus
Is there a way to format a SQL*Plus report so
numeric columns are not preceeded by a space?
I've already have the setting SET COLSEP ''
but that doesn't work on the numeric fields.
I've also tried setting the column format
and converting the numbers to strings. Any
help will be much appreciated!!Numeric values are preceeding with a blank because of the sign (which is not included in the definition number(3,2) = -9.99 to +9.99).
You need to convert to char and trim :
select trim(to_char(mynumber)) mynumber from mytable; -
I want to show the UNIX userID in my SQL*PLUS report's header whosoever will run the script report. Could someone help immediately please?
try with
select username , sid, osuser from v$session;
regards
S.N
Maybe you are looking for
-
I just purchase a brand new mac computer and I need to purchase new adobe CS software for work. Do you know if Adobe CS5 Design Premium-Mac is compatible with new mac computers with the updated Yosemite software? *No previous adobe CS software versio
-
Shudule manager SCMA MONTH END YERA END CONFIGURATION STEPS
Hi al Can u pls send me the configuration steps for month end and year end activities by using shudule manager regards Venkataswamy [email protected]
-
Editing Footers in a PDF Adobe Pro
When I edit the footer in my combined PDF document, some text disappears, while others turn into garbage or A's with a box around it. How can I fix this... or edit the footer where this will not happen?
-
[Solved] LaTeX and LyX problems after recent update
After the recent TeX update, problems arose that were already discussed in another thread, the solution is in a post by bender02. Because I use LyX instead of the "normal" latex command line tool, I was getting the following: The layout file requeste
-
Hi everybody, I have E61 code 0537110, firmware 1.6xxx... and newest NSU installed on my PC. But NSU says everytime, that there is no update for my E61 (but everybody talk about 2.xx... firmware). My E61 is operator unbranded phone. Anybody can help