Script output missing rows affected
Hi,
I'm not sure when it happened, but I notice that the script output no longer tells you how many rows have been affected by DML.
eg,
in sqlplus, if I do
"> delete from xx;"
it tells me.
"3 rows deleted."
but in sql developer all I get is
"delete from xx succeeded."
Is there any way to get sqldeveloper to tell me how many rows have been affected if I "Run Script"? Haven't it output the number of rows affected is a great "double check" that my query did what I expected, having it just say "succeeded" just tells me that it did something..
Hi,
I can now fix and reproduce this.
This morning I downloaded the latest MacOS version which reports as "MAIN-32.13" (same as the old one I was running). And what do you know, it correctly says the number of rows inserted/deleted/updated (I did not trash my prefs folders)
So, I diffed the two application directories, with the following differences.
laguna:Downloads $ diff -r SQLDeveloper.app/ /Applications/SQLDeveloper.app/
Only in /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/ide/lib/patches: timesten_support.jar
Binary files SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/doc/sqldeveloper_help.jar and /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/doc/sqldeveloper_help.jar differ
Only in /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/doc: sqldeveloper_help.jar.backup
Only in /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/extensions: oracle.sqldeveloper.timesten.jar
Only in /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper: timesten_readme.html
laguna:Downloads $
I then tried check for updates, and it picked up timesten extension, which I installed.
On the first restart after updates, I get the following error.
java.lang.IllegalAccessError: tried to access class oracle.ide.net.IdeURLStreamHandler from class oracle.ide.net.URLFileSystem$1
at oracle.ide.net.URLFileSystem$1.createURLStreamHandler(URLFileSystem.java:87)
at oracle.ide.boot.URLStreamHandlerFactoryQueue.createURLStreamHandler(URLStreamHandlerFactoryQueue.java:119)
at java.net.URL.getURLStreamHandler(URL.java:1104)
at java.net.URL.<init>(URL.java:393)
at java.net.URL.<init>(URL.java:283)
at oracle.ide.net.URLFactory.newURL(URLFactory.java:636)
at oracle.ide.layout.URL2String.toURL(URL2String.java:104)
at oracle.ideimpl.editor.EditorUtil.getURL(EditorUtil.java:150)
at oracle.ideimpl.editor.EditorUtil.getNode(EditorUtil.java:122)
at oracle.ideimpl.editor.EditorUtil.loadContext(EditorUtil.java:91)
at oracle.ideimpl.editor.TabGroupState.loadStateInfo(TabGroupState.java:950)
at oracle.ideimpl.editor.TabGroup.loadLayout(TabGroup.java:1751)
at oracle.ideimpl.editor.TabGroupXMLLayoutPersistence.loadComponent(TabGroupXMLLayoutPersistence.java:31)
at oracle.ideimpl.controls.dockLayout.DockLayoutInfoLeaf.loadLayout(DockLayoutInfoLeaf.java:123)
at oracle.ideimpl.controls.dockLayout.AbstractDockLayoutInfoNode.loadLayout(AbstractDockLayoutInfoNode.java:631)
at oracle.ideimpl.controls.dockLayout.AbstractDockLayoutInfoNode.loadLayout(AbstractDockLayoutInfoNode.java:628)
at oracle.ideimpl.controls.dockLayout.AbstractDockLayoutInfoNode.loadLayout(AbstractDockLayoutInfoNode.java:614)
at oracle.ideimpl.controls.dockLayout.DockLayout.loadLayout(DockLayout.java:302)
at oracle.ideimpl.controls.dockLayout.DockLayoutPanel.loadLayout(DockLayoutPanel.java:128)
at oracle.ideimpl.editor.Desktop.loadLayout(Desktop.java:356)
at oracle.ideimpl.editor.EditorManagerImpl.init(EditorManagerImpl.java:1879)
at oracle.ide.layout.Layouts.activate(Layouts.java:784)
at oracle.ide.layout.Layouts.activateLayout(Layouts.java:186)
at oracle.ideimpl.MainWindowImpl$6.runImpl(MainWindowImpl.java:734)
at oracle.javatools.util.SwingClosure$1Closure.run(SwingClosure.java:50)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
and my worksheets wont open (just stays with the blue background). Restarting fixes this, but... Back to the original problem.
If I then go and delete
/Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/
oracle.sqldeveloper.timesten.jar
and
/Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/ide/lib/timesten_support.jar
The problem is fixed again.. So its something with those Jars.
Similar Messages
-
SQL Worksheet - Script output is restricted to 5000 rows
Hello,
till now only 5000 rows are currently supported in a script results.
I have read, this count will be a preference in future releases. Is there such a release and if "yes" how can I change this count of rows?
Script Output of SQL Worksheet is the only possibility in SQL Developer I know, to export data from a query, that is a join of multiple tables, into flat file. Is there another one?
Thanks,
TzonkaYou can run your query as a statement (F9) and the results will be displayed in the Results tab. In the Results tab, you can right-click, select Export and then Text. This will allow you to export the results of the query into a text file (or the clipboard). This will enclose values with " and separate with tabs (allowing alternatives is another "wait for a later release" function).
This will produce the equivalent output of creating the view and exporting the data from the view tab as suggested by Sharon, without having to go to the effort of creating the view.
If by "flat file" you mean exactly what you would get with a spool from SQL*Plus, then the Script tab is your only option and you are restricted to the 5000 rows. -
To convert Sap Script output to PDF format and send it via email.
Hi Friends,
Could any one please tell me, how to convert the Sap Script output to PDF format and send it via email. If any one have the code, kindly mail me to [email protected]
Thanks & Regards,
JohnPlese check this sample code from other thread.
REPORT zzz_jaytest .
Types Declaration
TYPES : BEGIN OF ty_pa0001,
pernr TYPE pa0001-pernr,
bukrs TYPE pa0001-bukrs,
werks TYPE pa0001-werks,
END OF ty_pa0001.
Internal Table Declaration
DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
i_content_txt TYPE soli_tab, "Content
i_content_bin TYPE solix_tab, "Content
i_objhead TYPE soli_tab,
Work Area Declaration
w_pa0001 TYPE ty_pa0001, "For pa0001 Details
w_res TYPE itcpp, "SAPscript output
"parameters
w_otf TYPE itcoo, "For OTF
w_pdf TYPE solisti1, "For PDF
w_transfer_bin TYPE sx_boolean, "Content
w_options TYPE itcpo, "SAPscript output
"interface
Variable Declaration
v_len_in TYPE so_obj_len,
v_size TYPE i.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X', "X
c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
c_otf TYPE sx_format VALUE 'OTF', "OTF
c_pdf TYPE sx_format VALUE 'PDF', "PDF
c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
c_bin TYPE char10 VALUE 'BIN', "BIN
c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
"File Name
c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
START-OF-SELECTION.
Selecting the records from pa0001
SELECT pernr bukrs werks FROM pa0001
INTO TABLE i_pa0001 UP TO 10 ROWS.
Setting the options
w_options-tdcopies = 1 ."Number of copies
w_options-tdnoprev = c_x."No print preview
w_options-tdgetotf = c_x."Return of OTF table
w_options-tddest = c_locl."Spool: Output device
Opening the form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options
IMPORTING
RESULT = w_res.
LOOP AT i_pa0001 INTO w_pa0001.
Writting into the form
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
window = 'MAIN'.
ENDLOOP.
Closing the form
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Converting OTF data to single line
LOOP AT i_otf INTO w_otf.
CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
INTO w_pdf.
APPEND w_pdf TO i_content_txt.
ENDLOOP.
Converting to PDF Format
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = c_otf
format_dst = c_pdf
devtype = c_printer
CHANGING
transfer_bin = w_transfer_bin
content_txt = i_content_txt
content_bin = i_content_bin
objhead = i_objhead
len = v_len_in
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
v_size = v_len_in.
Downloading the PDF File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_size
filename = c_name
filetype = c_bin
TABLES
data_tab = i_content_bin.
The extension is put the it_mailpack-obj_name parameter of 'SO_NEW_DOCUMENT_ATT_SEND_API1'. -
How to count no of rows affected by a ref cursor ?
Hi,
I have taken a ref cursor inside the function since I want to return resultset to the calling application. I also need the NO. OF ROWS AFFECTED by the ref cursor. When I used refcur%rowcount, it returned me 0. Whereas actual no. of rows inside the table is 11.
As a workaround I created a integer variable v_rcount and again executed the cursor's query using count() to store the no. of rows affected by the cursor query. See definition 1 and 2 :
How can I get no. of rows affected by the ref cursor without taking additional variable ??? Any other means available ???
DEFINITION ONE:
create or replace function f_ref()
RETURN curpkg.ref_cursor as
stock_cursor curpkg.ref_cursor;
v_rcount INTEGER;
BEGIN
OPEN stock_cursor FOR SELECT * FROM FIRSTTABLE;
select count(*) into v_rcount from firsttable;
dbms_output.put_line('['|| v_rcount||']');
RETURN stock_cursor;
END;
OUTPUT:
[11]
DEFINITION TWO:
create or replace function f_ref()
RETURN curpkg.ref_cursor as
stock_cursor curpkg.ref_cursor;
v_rcount INTEGER;
BEGIN
OPEN stock_cursor FOR SELECT * FROM FIRSTTABLE;
v_rcount := stock_cursor%rowcount;
dbms_output.put_line('['|| v_rcount||']');
RETURN stock_cursor;
END;
OUTPUT:
[0]michaels> DECLARE
emp_row emp%ROWTYPE;
cur sys_refcursor;
FUNCTION f_ref
RETURN sys_refcursor
AS
stock_cursor sys_refcursor;
BEGIN
OPEN stock_cursor FOR
SELECT *
FROM emp;
RETURN stock_cursor;
END f_ref;
BEGIN
cur := f_ref;
LOOP
FETCH cur
INTO emp_row;
EXIT WHEN cur%NOTFOUND;
END LOOP;
DBMS_OUTPUT.put_line ('Fetched rows: ' || cur%ROWCOUNT);
CLOSE cur;
END;
Fetched rows: 14 -
SQL Developer Script Output too limited for student - how to increase?
I'm just a student trying to migrate from notepad and SQL Plus to using the SQL Developer for the comprehensive course project. Unfortunately, the script output is way too limited... it only reports a fourth of my last assignment's results - not enough to use in the project. How specifically can this be increased. I have version 1.1.0.21 running on Windows XP on a laptop with 512k memory.
Thanks much for any/all assist. I don't want to go back to notepad!!Thank you for the advice, but I had tried that. My script is 305 lines counting blank lines and the SQL developer displays only about 35 lines of results corresponding to 58 lines of input. When I run the same script in SQL Plus in a console window using the @filename command, I get the entire output.
My input and output follow:
Input:
spool project-test-out.txt
prompt 'name'
prompt 'Assignment X, parts 2b - 2h and 3a - 3b '
create table Customer (
CustID Integer,
Name Char(10),
State Char(2),
primary key (CustID) );
create view CustID_List (ID_Cust) as (select custID from Customer);
create table Inventory (
PartID Integer,
Item Char(10),
Cost Float,
OnHand Integer,
primary key (PartID) );
create table Invoice (
InvNum Integer,
InvDate DATE,
CustID Integer,
primary key (InvNum),
foreign key (CustID) references Customer);
create table Invoice_Item (
InvNum Integer,
PartID Integer,
Quantity Integer,
foreign key (InvNum) references Invoice,
foreign key (PartID) references Inventory);
insert into customer values ( 101, 'Kerry', 'MA' );
insert into customer values ( 102, 'Edwards', 'NC' );
insert into customer values ( 103, 'Cheney', 'TX' );
insert into customer values ( 104, 'Bush', 'TX' );
insert into Inventory values ( 1, 'Boots ', 149.95, 6 );
insert into Inventory values ( 2, 'Spurs ', 12.95, 24 );
insert into Inventory values ( 3, 'Buckle ', 19.95, 4 );
insert into Inventory values ( 4, 'Hat ', 60.00, 12 );
insert into Inventory values ( 5, 'Holster', 75.00, 8 );
insert into Inventory values ( 6, 'Saddle ', 350.00, 2 );
prompt 'Part grad 3b - unsatisfying solution, limitations of Oracle 10g Express'
prompt 'After many trials, found oracle discussion on web stating that'
prompt 'Oracle 9 does not allow subqueries in the trigger WHEN clause.'
prompt 'What a pain. Thus the solution here has become rather inelegant.'
prompt 'The trigger and following select statement are byproducts of various'
prompt 'simplification attempts, none of which worked.'
select ID_Cust from custID_List;
create trigger Invoice_CustID_CK before insert on Invoice
REFERENCING NEW AS newCustID
FOR EACH ROW
BEGIN
if (:newCustID.CustID = 205 )
-- {{want line below but it generates error of: subquery not allowed in }}
-- {{this context }}
-- if (:newCustID.CustID NOT IN
-- (Select ID_Cust from CustID_List))
then :newCustID.CustID := NULL;
end if;
END;
run;
show errors trigger Invoice_CustID_CK;
insert into invoice values ( 201, '01-Aug-2006', 101 );
insert into invoice values ( 202, '02-Sep-2006', 101 );
insert into invoice values ( 203, '05-Oct-2006', 103 );
insert into invoice values ( 204, '07-Oct-2006', 102 );
insert into invoice values ( 205, '09-Oct-2006', 205 );
insert into Invoice_Item values ( 201, 1, 1 );
insert into Invoice_Item values ( 201, 2, 1 );
insert into Invoice_Item values ( 202, 5, 2 );
insert into Invoice_Item values ( 203, 1, 2 );
insert into Invoice_Item values ( 203, 2, 2 );
insert into Invoice_Item values ( 203, 3, 2 );
insert into Invoice_Item values ( 203, 4, 2 );
insert into Invoice_Item values ( 204, 4, 2 );
insert into Invoice_Item values ( 204, 1, 1 );
select * from invoice;
select * from customer;
select * from invoice_item;
select * from inventory;
prompt 'Preparation for part 2b - create view showing onhand and starting inventory'
alter table inventory add (start_inventory integer);
update inventory
set start_inventory = onhand;
create view inv_changes as
select partid, sum(quantity) as sales_by_id
from invoice_item
group by partid;
create table inventory_invoiced as
select inventory.partid, item, cost, onhand, start_inventory, COALESCE (sales_by_id, 0) as sales_by_id_NZ
from inventory left outer join inv_changes
on inventory.partid = inv_changes.partid;
select * from inventory_invoiced;
update inventory_invoiced
Set
onhand = onhand - sales_by_id_NZ;
select * from inventory_invoiced;
prompt 'Part 2b - What item has the least on hand inventory after processing the invoices?'
select item
from inventory_invoiced
where onhand = (select min(onhand) from inventory_invoiced);
prompt 'Part 2c - How much does customer 101 owe?'
create view cust101_orders as
select distinct partID, quantity
from invoice_item, invoice
where invoice_item.invnum IN
(select I.invnum from invoice I where I.custid = 101);
select * from cust101_orders;
select sum(quantity * cost) as cust101_bill
from cust101_orders, inventory
where cust101_orders.partID = inventory.partID;
prompt 'Part 2d - Which customer has the biggest bill?'
prompt ' desirable solution is to do part 2c as a general case '
prompt ' using a stored function such that the custID is passed '
prompt ' to the function. Unfortunately, neither function below '
prompt ' compiles. First case trips on creating the view. Second'
prompt ' case being arewrite without a view - ifit even works - '
prompt ' trips on the complicated select'
create or replace function ind_customer_bill
(ind_customer_ID in integer)
return Float
IS ind_total_bill Float;
begin
create view cust_orders as
select distinct partID, quantity
from invoice_item.invnum IN
(select I.invnum from invoice I where I.custid = ind_customer_ID);
select sum(quantity * cost) into ind_total_bill
from cust_orders, inventory
where cust_orders.partid = inventory.partid;
drop view cust_orders;
return (ind_total_bill);
end;
show errors function ind_customer_bill;
create or replace function ind_customer_bill
(ind_customer_ID in integer)
return Float
IS ind_total_bill Float;
begin
select sum(quantity * cost) into ind_total_bill
from inventory, (select distinct partID as interim_partID, quantity
from invoice_item.invnum IN
(select I.invnum from invoice I where I.custid = ind_customer_ID))
where interim_partID = inventory.partid;
return (ind_total_bill);
end;
show errors function ind_customer_bill;
Prompt 'part 2d continued using shameful brute force technique'
select * from cust101_orders;
create view cust101_due as
select sum(quantity * cost) as cust101_bill
from cust101_orders, inventory
where cust101_orders.partID = inventory.partID;
create view cust102_orders as
select distinct partID, quantity
from invoice_item, invoice
where invoice_item.invnum IN
(select I.invnum from invoice I where I.custid = 102);
select * from cust102_orders;
create view cust102_due as
select sum(quantity * cost) as cust102_bill
from cust102_orders, inventory
where cust102_orders.partID = inventory.partID;
create view cust103_orders as
select distinct partID, quantity
from invoice_item, invoice
where invoice_item.invnum IN
(select I.invnum from invoice I where I.custid = 103);
select * from cust103_orders;
create view cust103_due as
select sum(quantity * cost) as cust103_bill
from cust103_orders, inventory
where cust103_orders.partID = inventory.partID;
create view cust104_orders as
select distinct partID, quantity
from invoice_item, invoice
where invoice_item.invnum IN
(select I.invnum from invoice I where I.custid = 104);
select * from cust104_orders;
create view cust104_due as
select sum(quantity * cost) as cust104_bill
from cust104_orders, inventory
where cust104_orders.partID = inventory.partID;
prompt 'and the answer to part 2d - biggest bill is'
select *
from cust101_due, cust102_due, cust103_due, cust104_due;
prompt 'Part 2e - What items were the most popular (most sold)'
select item
from inventory_invoiced
where sales_by_id_NZ >= ANY (
select max(sales_by_id_NZ) from inventory_invoiced);
prompt 'Part 2f - What was the value of the original inventory'
select sum (start_inventory * cost) as total_start_inventory
from inventory_invoiced;
prompt 'Part 2g - What was the value of the ending inventory'
select sum (onhand * cost) as total_ending_inventory
from inventory_invoiced;
prompt 'Part 2h - What customers did not place an order'
-- after some testing of the inner nest parts wherein the left outer join
-- results in a CustID_List entry 104 having a null entry in
-- invoice's CustID list.
select Name
from customer
where custID IN (select ID_Cust
from (select ID_Cust, CustID
from CustID_List left outer join invoice on
ID_Cust = CustID)
where CUSTID IS NULL);
prompt 'Part 3a - What items were not purchased by anyone'
select item as unpurchased
from inventory_invoiced
where sales_by_id_nz = 0;
prompt 'Part 3b - table modifications for invoices to have valid CustID'
prompt ' -- see 3b section at top of file, notes and trigger '
drop view cust101_due;
drop view cust102_due;
drop view cust103_due;
drop view cust104_due;
drop function ind_customer_bill;
drop view cust101_orders;
drop view cust102_orders;
drop view cust103_orders;
drop view cust104_orders;
drop table inventory_invoiced;
drop view inv_changes;
drop view custID_List;
drop table invoice_item;
drop table invoice;
drop table inventory;
drop table customer;
Output:
'name'
'Assignment X, parts 2b - 2h and 3a - 3b '
create table succeeded.
create view succeeded.
create table succeeded.
create table succeeded.
create table succeeded.
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
1 rows inserted
'Part grad 3b - unsatisfying solution, limitations of Oracle 10g Express'
'After many trials, found oracle discussion on web stating that'
'Oracle 9 does not allow subqueries in the trigger WHEN clause.'
'What a pain. Thus the solution here has become rather inelegant.'
'The trigger and following select statement are byproducts of various'
'simplification attempts, none of which worked.'
ID_CUST
101
102
103
104
4 rows selected
trigger Invoice_CustID_CK Compiled. -
2 Dumb Questions: Toggle Script Output tab / Set Serverouput Toggle
I use SQL Developer quite a lot, but I need some basic help
I'm using SQL Develeoper 3.0.04
Question 1.
If I ever close [X] the Script Output tab/window, I have a huge headache trying to open/unhide it again. I can't do it!
I've looked in the menus,
Preferences / Keyboard shortcuts etc but I just can't see it.
So how to a make the Script Output tab re-appear? THere must be a toggle somewhere.
Question 2.
In a previous version of SQL developer, I used SET SERVEROUTPUT ON.
The output from all my dbms_output.print_line statements would appear in the script output window FOR THE ENTIRE SESSION.
In this version that I'm using, everytime I run an anon block I have to preceed the block with SET SERVEROUTPUT ON.
It doesn't remain ON for the entire session. It only affects the next block of code that I try to execute.
An I doing something wrong?
Thanks for any help.
StuWelcome to the forum!
Thanks for providing the sql developer version. Functionality can, and does, change between versions.
>
Question 2.
In a previous version of SQL developer, I used SET SERVEROUTPUT ON.
The output from all my dbms_output.print_line statements would appear in the script output window FOR THE ENTIRE SESSION.
In this version that I'm using, everytime I run an anon block I have to preceed the block with SET SERVEROUTPUT ON.
It doesn't remain ON for the entire session. It only affects the next block of code that I try to execute.
>
Have you tried using the DBMS_OUTPUT window?
Select 'view -> DBMS Output
Then if you roll-over the '+' sign on the DBMS Output Window toolbar you will see that it says 'ENABLE DBMS_OUTPUT FOR CONNECTION'.
Click it and all output should display in the window. -
Long lines corupt script output
When SQL run as Script (F5) produces too long lines any Script Output gets blank. Text is there in tab Script Output and I can copy and past it but I can't see it.
What setting could affect this?
--This SQL is working fine
select rpad('Test1',4000), rpad(' ',996) from dual;
--and this sql output is white on white:
select rpad('Test2',4000), rpad(' ',997) from dual;
Adam Dziurda
PS. Affected version Oracle SQL Developer Version 4.0.0.12.27 (aka 4.0 EA1)Yes, I see that. I've logged bug 17218146 for it.
Thanks
Barry -
Is it possible to remove the header from query results in the the script output window?
select 1 AS dont, 2 AS need, 3 AS a, 4 AS header, 5 AS thanks from dual;
DONT NEED A HEADER THANKS
1 2 3 4 5
I only want the row of "1 2 3 4 5".
In SQL Plus, I arrange like so:
SQL> select 1 AS dont, 2 AS need, 3 AS a, 4 AS header, 5 AS thanks from dual;
DONT NEED A HEADER THANKS
1 2 3 4 5
SQL> set heading off;
SQL> select 1 AS dont, 2 AS need, 3 AS a, 4 AS header, 5 AS thanks from dual;
1 2 3 4 5
SQL>
However, 'set heading off' in SQL Developer gives "line 1: SQLPLUS Command Skipped: set heading off;"
Is this possible? If not, can it be put in the request pile for a future release?Can't be done currently...
Requests should go to the announced SQL Developer Exchange, so others can vote on them.
Regards,
K. -
Displaying Missing Rows in a Group By Select Statement
I have a query that looks like the following
select coll_time,sum(coll_size) from coll_table
where coll_time between '2007-11-15' and '2007-11-20'
group by coll_time;
This returns
coll_time sum(coll_size)
2007-11-15 123456
2007-11-16 234567
2007-11-17 345678
2007-11-19 456789
As you can see, there is no data for the 18th.
Can someone please explain how I can have the query output a row for the 18th. The sum can be 0 or null.
Thanks.I may be missing something because when I execute the query against my data I'm still missing the missing dates. I'd like to see all the data (even 0) from Nov 10 to December 20. However when I perform the query I get information only for the dates for which there is data. Note that I am missing line items for Nov 18 as well as Dec 19/20 among others.
Thanks for your help.
VARIABLE start_date varchar2(100);
VARIABLE max_date varchar2(100);
EXEC :start_date := '2007-11-10';
EXEC :max_date := '2007-12-20';
WITH all_dates AS (
SELECT
to_date(:start_date,'yyyy-mm-dd') + level - 1 AS the_date
FROM
dual
CONNECT BY
level <= to_date(:max_date,'yyyy-mm-dd') - to_date(:start_date,'yyyy-mm-dd') + 1
SELECT
to_char(rcm.time, 'yyyy-mm-dd') coll_date,
SUM(rcm.datasize) dsize
FROM
all_dates ad,METRICS rcm
WHERE
rcm.ta = 'TEST_03'
AND
trunc(ad.the_date) = trunc(rcm.time (+))
GROUP BY
to_char(rcm.time, 'yyyy-mm-dd')
ORDER BY 1;
COLL_DATE DSIZE
2007-11-14 44902934
2007-11-15 44902934
2007-11-16 44902934
2007-11-17 22451467
2007-11-19 67354401
2007-11-20 44902934
2007-11-21 44902934
2007-11-22 44902934
2007-11-23 44902934
2007-11-24 44902934
2007-11-25 44902934
2007-11-26 44902934
2007-11-27 44902934
2007-11-28 44902934
2007-11-29 44902934
2007-11-30 89805868
2007-12-01 44902934
2007-12-03 22451467
2007-12-04 22451467
2007-12-05 67354401
2007-12-06 44902934
2007-12-07 44902934
2007-12-08 22451467
2007-12-09 22451467
2007-12-10 22451467
2007-12-11 44902934
2007-12-12 44902934
2007-12-13 44902934
2007-12-14 44902934
2007-12-15 44902934
2007-12-16 44902934
2007-12-17 44902934
2007-12-18 44902934 -
Turn off Script Output like set termout off
Version:
Oracle SQL Developer 2.1.0.63
Version 2.1.0.63
Build MAIN-63.73
Running on Windows XP SP2
I have a DML script with 217439 rows( ~40meg filesize ). Of course it loads slowly and the IDE is consuming large amounts of memory. About halfway through the processing of this file it becomes painfully slow( very similar to Quest's SQL Navigator ) around the 100,00 record mark. It feels like a resource issue as a result of the script output constantly reporting/recording the 1 record inserted message.
Is there a way to SET TERMOUT OFF; in SQL Developer so this output is ignored?Hi Squiggles,
Set termout on works in 2.1.1 (I checked a beta release of 2.1 and set termout off was already implemented so it should be in 2.1).
It has to be a sub script you are running - not just in the top level directory:
so given pm.sql is:
prompt promptme
set termout on
select 1 from dual;
@/home/totierne/pm.sql
gives
1
1
promptme
and
set termout off
select 1 from dual;
@/home/totierne/pm.sql
gives
1
1
[ie no prompt me]
I just did a quick check on the spool side - set term off just turns off the terminal - output still goes to the spool file - but that should not cause a huge slowdown (as long as the disk does not fill up) it is just appending to a file not keeping it in memory or displaying the entire chunk of data.
-Turloch -
Table call statisitcs: ROWS AFFECTED ?
Hello,
the table call statistics (ST10) provides one column with the number of rows affected. This is the number of rows that have been read from the database. But the size of a row among tables are different. One row can have a size of 120Kb in one table or 5 Kb in another table.
So how is it to understand? What does it mean in KBytes if one row of a table is affected?
Thx, holger
Message was edited by: Holger Schmidt
Message was edited by: Holger SchmidtHi Holger,
Unfortunately, this list output be ST10 is not oriented towards the Size of the call. The program RSTABL11 prints this list.
One way to achieve this may be to copy the program RSTABL11 to suit your reporting requirements, such as getting the table row lengths and multiplying the rows with these lenghts.
This new program can then be called independently. Look at how the RSTABL11 is submitted in SAPMST10.
Hope this helps,
Bhanu
Hope this helps,
Bhanu -
Changes are not reflected in Script output
Hi All,
i am facing a problem in SAPscript.
I have made a Zscript by copying standard script F110_FR_CHEQUE. I have made the changes in the script as per requirement in development client and transported it to testing client to test (As i dont have any data in development client). But, surprisingly, when i run the program and check the output, the changes are not reflected in the script output.
First i thought that my script was not triggered thats whay i m not getting any change, but later i changed the dimension of one of the window, in which some hard coded text is written, the differece i found was that, window size is changed, but the text written in that window is still same (what was in standard script.) .
I am using standard texts for hard coding in script. Standard texts have been transported in testing client also.
please help me in this regard.Hi,
Could you plese Check NACE whether your script is confiugring or not.
If it is configured well then Check Standard Text is available or not in Test client by open it in SO10.
Check all the paragrah formats applied to Standard text are transferred to Test client which are in SE72.
IF it is available in SO10 then debug the print program for that windows any standard conditions are calling to print the text. -
Convert Script output data to Text(.txt) file & send mail with attachment.
Hi All,
Requirement: I shulb be able to conver th Script output data to Text(.text) file & send a maill with attachment with this text file. Formant of text file should be like output of Print priview.
Plese sugget with Function modules to cover as Text file.
I am able to converting the Script output data to PDF and sending mail with attachment. So I don't want PDF file now.
Thanks in advance.Hi, Thanks for responst.
We can convert the Scirpt output to PDF file by using OTF function module and the PDF file looks like Print Privew output.
Same like this I want Script out in NOTEPAD (.txt). Is that possible, Plz sugget with relavent Function Modules.
Thanks. -
4.0EA1 - Copy/Paste in Script Output window on Mac is not working
I'm running 4.0.0.12 on MacOS X 10.8.4, and I can't Copy from the "Script Output" window. What I regularly do is generate some SQL using an SQL query, so I want to copy the output and paste it back into the Worksheet so I can run it. For example:
select 'alter tablespace ' || TABLESPACE_NAME || ' begin backup;' from DBA_TABLESPACES;This is a known issue and will be addressed for the next EA release.
-
Problem in script output sending mail
hi ,
I have a problem sending a mail with script output as attachment . I have searched in the forum for the answers but none is solved my question.
I am sending the data to the otf and it is getting the otfdata. but it is not showing the data on the script when it is sent as an attachment to the email , but it is showing only script with null values filled.( means i am getting the mail with attachment but in that attachment there is no data filled in the script send).
the code is like this ..
here i am filling the otfdata and i am exporting the otfdata
CALL FUNCTION 'ZMM_ARRANG_ENTRY_ABR_NATRAB'
EXPORTING
i_nast = nast
i_fonam = tnapr-fonam
i_xscreen = pi_xscreen
i_arc_params = arc_params
i_toa_dara = toa_dara
IMPORTING
e_retcode = px_retcode
EXCEPTIONS
OTHERS = 1.
IF ( sy-subrc <> 0 ). "Fehler
MOVE sy-subrc TO px_retcode.
IF ( pi_xscreen = 'X' ). "Ausgabe auf Bildschirm
MESSAGE ID sy-msgid
TYPE sy-msgty
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ELSE.
*---Import OTFDATA from the memory
IMPORT it_otfdata FROM MEMORY ID 'OTF'.
ENDIF.
wa_maildata-obj_name = 'EMAIL'.
wa_maildata-obj_descr = 'Settlement Details'.
*-----mail contents
it_mailtext-line = 'Sub-sequent settlement Details'.
APPEND it_mailtext.
DESCRIBE TABLE it_mailtext LINES v_lines.
READ TABLE it_mailtext INDEX v_lines.
wa_maildata-doc_size = ( v_lines - 1 ) * 255 + STRLEN( it_mailtext ).
*Creation of the entry for the compressed document
CLEAR it_mailpack-transf_bin.
it_mailpack-head_start = 1.
it_mailpack-head_num = 0.
it_mailpack-body_start = 1.
it_mailpack-body_num = v_lines.
it_mailpack-doc_type = 'RAW'.
APPEND it_mailpack.
*-----Get OTF data
LOOP AT it_otfdata.
it_mailcont-line = it_otfdata.
APPEND it_mailcont.
ENDLOOP.
*---Move OTF data into binary table
LOOP AT it_mailcont.
MOVE-CORRESPONDING it_mailcont TO it_mailbin.
APPEND it_mailbin.
ENDLOOP.
*---Get no of lines in Binary data table
DESCRIBE TABLE it_mailbin LINES v_lines.
*---Fill name of the header of email
it_mailhead = 'Subsequent Settlement Details.OTF'.
APPEND it_mailhead.
*---Creation of the entry for the compressed attachment
it_mailpack-transf_bin = 'X'.
it_mailpack-head_start = 1.
it_mailpack-head_num = 1.
it_mailpack-body_start = 1.
it_mailpack-body_num = v_lines.
it_mailpack-doc_type = 'OTF'.
it_mailpack-obj_name = 'EMAIL'.
it_mailpack-obj_descr = 'Settlement Details'.
it_mailpack-doc_size = v_lines * 255.
APPEND it_mailpack.
*----Get email address from the address number of vendor
CALL FUNCTION 'ADDR_GET_REMOTE'
EXPORTING
addrnumber = l_adrnum
TABLES
adsmtp = it_adsmtp.
*----Get mail address
READ TABLE it_adsmtp WITH KEY remark = 'AP_SUB_SETT'.
IF sy-subrc = 0.
it_mailrec-receiver = it_adsmtp-smtp_addr.
it_mailrec-rec_type = 'U'.
it_mailrec-com_type = 'EXT'.
APPEND it_mailrec.
*---Send email with PDF attachment
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_maildata
put_in_outbox = 'X'
COMMIT_WORK = 'X'
TABLES
packing_list = it_mailpack
object_header = it_mailhead
contents_bin = it_mailbin
contents_txt = it_mailtext
receivers = it_mailrec.
ELSE.
MESSAGE 'No email id Exist for the vendor' TYPE 'E'.
ENDIF.
please suggest me with your valuable answers .
Regards,
Venkat Appikonda.Hi venkat
Just check if this helps you.
The following part of the code does exactly that.
Selecting details from the spool request table.
SELECT * FROM tsp01 INTO TABLE tb_spool
WHERE rqowner = sy-uname.
IF sy-subrc EQ 0.
SORT tb_spool DESCENDING BY rqcretime.
CLEAR : tb_spool.
READ TABLE tb_spool INDEX 1.
convert spool into PDF format.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = tb_spool-rqident
TABLES
PDF = tb_lines.
ENDIF.
After this, on execution we get the below mentioned message.
This indicates that a PDF of the SAP Script has been created which is in the format u201C132-long stringsu201D.
In order to send the mail across, the mailing format of the PDF supports u201C255-long stringsu201D. So, the present u201C132-long stringsu201D needs to be converted into u201C255-long stringsu201D. This along with the mail code is mentioned below.
DATA: lv_receiver(50) TYPE c.
REFRESH: tb_obj_txt,
tb_obj_bin,
tb_obj_head,
tb_paklist,
tb_receiver.
CLEAR: tb_obj_txt,
tb_obj_bin,
tb_paklist,
tb_obj_head,
tb_receiver.
CLEAR: tb_adrc.
IF NOT tb_adrc[] IS INITIAL.
Reading the address table with the key as address number.
READ TABLE tb_adrc WITH KEY addrnumber = tb_kna2-adrnr.
IF sy-subrc EQ 0.
Vendor Email ID.
SELECT SINGLE smtp_addr
FROM adr6
INTO wf_mailaddr
WHERE addrnumber = tb_adrc-addrnumber.
IF sy-subrc EQ 0.
Moving the mail address to the receiver itab
MOVE wf_mailaddr TO tb_receiver-receiver.
tb_receiver-rec_type = text-011.
APPEND tb_receiver.
ELSE.
CONCATENATE text-004 tb_kna2-kunnr text-005 INTO lv_receiver
SEPARATED BY space.
If pa_call is initial, the receiver ID is printed; else an INVALID E-mail ID message gets flashed.
IF pa_call IS INITIAL.
WRITE :/ lv_receiver.
ENDIF.
CLEAR: itab.
itab-kunnr = tb_kna2-kunnr.
itab-message = lv_receiver.
APPEND itab.
EXIT. u201CNo mailing for invalid Email id
ENDIF.
ENDIF.
ENDIF.
wf_name = sy-uname.
wf_year = tb_main-bldat(4).
wf_mon = tb_main-bldat+4(2).
*This FM gives the name of the months.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = sy-langu
TABLES
month_names = tb_months.
IF sy-subrc EQ 0.
READ TABLE tb_months WITH KEY mnr = wf_mon.
IF sy-subrc EQ 0.
wf_name = tb_months-ktx.
ENDIF.
ENDIF.
CLEAR: tb_contp.
IF NOT tb_contp[] IS INITIAL.
*Reading the contp itab as per the customer entered on the selection screen.
READ TABLE tb_contp WITH KEY bukrs = pa_bukrs
kunnr = tb_kna2-kunnr.
IF sy-subrc EQ 0.
CONCATENATE text-006 text-008 tb_contp-contp text-008 tb_kna2-kunnr
text-008 wf_name text-008 wf_year INTO wf_sub.
ENDIF.
ELSE.
CONCATENATE text-006 text-008 tb_kna2-kunnr text-008 wf_name
text-008 wf_year INTO wf_sub.
ENDIF.
Subject and Description
CLEAR wa_docdata.
wa_docdata-obj_name = text-007.
wa_docdata-obj_descr = wf_sub.
wa_docdata-obj_langu = sy-langu.
Write main body
tb_obj_txt = text-009.
APPEND tb_obj_txt.
CLEAR tb_obj_txt.
CLEAR tb_paklist.
tb_paklist-head_start = 1.
tb_paklist-head_num = 3.
tb_paklist-body_start = 1.
tb_paklist-body_num = 60.
tb_paklist-doc_type = text-012.
APPEND tb_paklist.
CLEAR tb_paklist.
create PDF file
Transfer the 132-long strings to 255-long strings
LOOP AT tb_lines.
TRANSLATE tb_lines USING ' ~'.
CONCATENATE wf_buffer tb_lines INTO wf_buffer.
ENDLOOP.
TRANSLATE wf_buffer USING '~ '.
DO.
tb_obj_bin = wf_buffer.
APPEND tb_obj_bin.
SHIFT wf_buffer LEFT BY 255 PLACES.
IF wf_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
DESCRIBE TABLE tb_obj_bin LINES lv_lines.
READ TABLE tb_obj_bin INDEX lv_lines.
lv_size = ( lv_lines - 1 ) * 255 + STRLEN( tb_obj_bin ).
Create attachment notification
tb_paklist-transf_bin = co_x.
tb_paklist-head_start = 1.
tb_paklist-head_num = 0.
tb_paklist-body_start = 1.
tb_paklist-body_num = lv_lines.
tb_paklist-doc_type = text-013.
tb_paklist-obj_descr = text-010.
tb_paklist-obj_name = text-010.
tb_paklist-doc_size = lv_size.
APPEND tb_paklist.
*mail the PDF to the receiver.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_docdata
sender_address = wf_name
sender_address_type = text-014
TABLES
packing_list = tb_paklist
object_header = tb_obj_head
contents_bin = tb_obj_bin
contents_txt = tb_obj_txt
receivers = tb_receiver
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
CONCATENATE text-003 tb_kna2-kunnr text-005 INTO lv_receiver
SEPARATED BY space.
CLEAR: itab.
itab-kunnr = tb_kna2-kunnr.
itab-message = lv_receiver.
APPEND itab.
IF pa_call IS INITIAL.
WRITE :/ lv_receiver.
ENDIF.
ELSE.
CONCATENATE text-002 tb_kna2-kunnr text-005 INTO lv_receiver
SEPARATED BY space.
CLEAR: itab.
itab-kunnr = tb_kna2-kunnr.
itab-message = lv_receiver.
APPEND itab.
IF pa_call IS INITIAL.
WRITE :/ lv_receiver.
ENDIF.
ENDIF.
Hope this helps.
Harsh
Maybe you are looking for
-
Clearing between customer and vendor invoice with F110 transaction
Hello, I have an issue related to the functionalities of the transaction F110. I'd like to clear the vendor invoice with the custome invoice. Customer and vendor records are linked properly and the flag 'Clrg with Cust.' is set on vendor and 'Clearin
-
How to Add new column in cross tab reports
I am using crystal reports 10 I created cross tab report for monthly sales. I need to add one more column in that report ex: Month Customer Part1 Part2 Part3 Jan A 10 12 15 Jan B
-
I need to add a link to to a discussion in the Wiki, where is the "eid"
Hi, The markup help has this text: [[<topic>:eid]] - link to a discussions topic [[<topic>:eid#msg-eid]]- link to a message reply in a discussions topic How do I get the eid? Regards, -sunny
-
Help needed to detect end of movie
I am using loadMovie to play an external SWF file in my main movie. How can I detect when the loaded movie has ended so I can move onto the next frame? Thx
-
"Print report REKORD 80 has not selected any data for correspondence SAP18"
When executed FBCJ transaction click the "print cash journal" button then appears the following message "Print report REKORD 80 has not selected any data for correspondence SAP18" What is the procedure for to fix error? Best regards John