SQL & PL/SQL :: Spooling Every 25 Rows In Excel?

Oct 11, 2012

I need to create a program wherein it will create an excel files through spool command for every 25 records only. So if my select statement will return 100 records, it will create 4 excel files, 25 records for each excel file. i have these sample codes,it should be the logic, but then i'm having syntax error.

set serveroutput on size 1000000
SET PAGESIZE 0
SET LINESIZE 299

[Code].....

View 8 Replies


ADVERTISEMENT

Spooling Into Excel - Retrieves Data From Different Table

Dec 25, 2010

i have a requirement..i have a script which retrieves data from different table and my requirement is using spool, i need the data from each table to be spooled into different sheets in the same excel sheet.

CODEspool d:\spool\spool1.xls
select * from tab1;
select * from tab2;
select * from tab3;
spool off

in the above code, data from tab1 should be spooled into sheet1 and data from should be spooled into sheet2 and so on.. in the same excel.

View 7 Replies View Related

Forms :: Copy Rows From Excel And Paste In 6i Program?

Sep 28, 2007

I want to copy some rows in one column from Excel and Paste it in a Oracle Forms Progam. Normaly with the clipboard. But my Oracle Forms 6i Program copy alle the rows in one Field, separated with a | character. But I need it in several rows.

View 12 Replies View Related

Reports & Discoverer :: Generate Excel Report Output With Maximum No Of Rows?

Nov 24, 2011

I created an xml report of output type 'xsl'. When the report output is generated for more than 65,536 rows then the report out put is not opening. generate excel report output with maximum no of rows.

View 1 Replies View Related

Application Express :: Export Table Rows To Excel And Save To BLOB Field?

Sep 26, 2012

I try to find out how export data from table to Excel file format and save the result to BLOB field in some other table.I know how to download report from Page by submit, but I need to process data and instead of returning result to user as Excel file - save it in BLOB.

Also I found implementation on JAVA for the issue but actually I wanna study out - Is it possible to resolve this issue by PL/SQL and APEX API methods?

View 4 Replies View Related

SQL & PL/SQL :: Spooling From XML

Mar 29, 2010

I am using Oracle 10g and I have XML stored in column XMLTYPE of my table. I want the XML in a flat file and process it to C exe.
My XML Structure is like this

<Data>
<Tag1>
<id>val1</id>
</Tag1>
<Account>
<Number>1111119&</Number>
</Data>

When I try to spool the XML i get the o/p without new line format as

<Data><Tag1><id>val1</id></Tag1><Account><Number>1111119&</Number</Data>

I want the o/p with new line after every tag and replace character like & to & . i can use utl_file too but spool is easy

View 2 Replies View Related

SQL & PL/SQL :: Spooling Xml Column Into One Single Row?

Jun 17, 2013

I have been trying to spool a table into a .lst. The table is spooled correctly, but there is a column which has xmlType data into. The problem is it does not write the xml into a single row. Every time it find a xml node, the spooling gets indented.

My code is as follows:

-- Establece opciones de formato.
set echo off;
set feedback off;
set heading off;
set recsep off;
set verify off;
set embedded off;
set long 1000000;
set pagesize 0;
SET LINESIZE unlimited;
set trimout off;
set trimspool on;
set serveroutput on size unlimited;
set term on;

-- Definicion de variables del script
prompt Introducir Creador de la tabla
prompt Creador de la tabla: &&1
prompt Introducir Nombre de la tabla
prompt Nombre de la tabla: &&2
prompt Introducir Directorio del fichero
prompt Directorio del fichero: &&3
prompt Introducir Nombre del fichero
prompt Nombre del fichero: &&4
prompt Introducir Caracter separador de campos
prompt Caracter separador de campos: &&5
prompt Campo fecha: &&6

-- Redirige la salida al fichero

spool /&&3/&&4
SELECT H5279_CD_EMP || '&&5' ||
H5279_LOCAL_ID || '&&5' ||
H5279_LOG_TYPE || '&&5' ||
H5279_GLOBL_ID || '&&5' ||
TO_CHAR(H5279_CREATED, 'YYYY-MM-DD HH24:MI:SS.FF3') || '&&5' ||

[Code] .......

where the field LOGDATA contains the xml. And the output im getting is as follows(I have attached the file)

0049|16052B0E44E3A30037E3CB59|4|16052B0E44E3BF0037D9CB4E|2013-06-12 11:51:16.387|16052B0E44E3A90037E2CB58|n31001|172.31.184.2|trxOpService|BDPESP_CIC_SAN_ENS_V1|||INTERNET|ALN_BDPGPO_Localizperscomun|| OI_LocalizarPersPorDocumentoComun|||ISWSBKSD149|frNixc6Vlic01jhixt5TkfT|16052A9553AE930037FAC740| <?xml version="1.0" encoding="ISO-8859-1"?>

[Code]....

View 5 Replies View Related

Spooling Column Headers Correctly

Sep 13, 2012

Im trying spooling a file in DB with below mentioned details.

SET SERVEROUTPUT OFF
set heading on
SET PAUSE OFF
SET FEED OFF
SET PAGES 0
[code]........

file .sql has 20 odd columns.

When file is spooled, it shows no columns headers at the top, why is it happening, I don't want to spool column headers separately.

View 12 Replies View Related

Client Tools :: Spooling Output In Windows

May 12, 2010

I am an IT auditor who has been using Oracle 10g Express to test some audit scripts we have created. I write the output of each query in the script to a separate file because it makes it easier for us to go through. However, I cannot get SQLPlus to spool the output files at all. I do not get any errors from running the script, and I can see the results in the SQLPlus window, but I cannot find where the files are actually spooling to, if they are spooling at all.

I didn't specify a network path for any of the spool files because the scripts need to be as generic as possible so they can run on any Windows or UNIX box. An example of my code is below:

spool Audit_Ver

SELECT * FROM V$VERSION;

spool off

But if I search my harddrive for "Audit_Ver" no such file can be found anywhere.

View 7 Replies View Related

SQL & PL/SQL :: Spooling Data In Pipe Delimited File

Feb 15, 2010

I am trying to Spool the data in pipe delimitted csv file but some of the records going on another line from the same records. Currently some of the data going to next line as below oulined in the 2nd and 3rd line (in bold - |Home & Family) . I have following sql setting in my spool file:

set linesize 4000 pagesize 0 trimspool on feedback off verify off echo off
set define off
spool Stk_hold_Sec_Tsk.csv

I tried increase linesize to 5000 but its not working.
Ex.

PSS:Production Manager|ZS:PsS:PP:PROD_TCODES|P2S: PP - Production Transactions|House & street
PSS:Production Manager|ZC:BW:PsS_RPT_MGR|BW PsS Reports Manager
[b]|House & street[/b]

PsS:Production Manager|ZC:BW:PsS_RPT_USER|BW PsS Reports User
[b]|House & street[/b]

PsS:Master Data (PDMs)|ZS:GEN:GENERAL_USER|GEN: General User|House & street

Data should be like into the file:

PSS:Production Manager|ZS:PsS:PP:PROD_TCODES|P2S: PP - Production Transactions|House & street
PSS:Production Manager|ZC:BW:PsS_RPT_MGR|BW PsS Reports Manager|House & street
PsS:Production Manager|ZC:BW:PsS_RPT_USER|BW PsS Reports User|House & street
PsS:Master Data (PDMs)|ZS:GEN:GENERAL_USER|GEN: General User|House & street

I think it should be something with linesize or pagesize but not sure

View 18 Replies View Related

Client Tools :: How To Remove Dotted Line While Spooling

Jan 27, 2010

i have a issue that when i spool the sql command i get a doted lines below the heading. how to eliminate the doted line but need the heading.

Previous:
OCCUPACODE OCCUPADESC
-------------------- -----------------------------------
1 BUSINESS
2 SERVICE

Needed :
OCCUPACODE OCCUPADESC

1 BUSINESS
2 SERVICE

View 1 Replies View Related

PL/SQL :: Spooling Data From Remote Server To Local Machine

Feb 6, 2013

I need to spool data from a remote server using putty(sqlplus) to a local machine. There are credentials i need to give before accessing the remote databases and i am able to do it..i tired with the below query but the spool file(csv or txt) is not able to create on local machine.

set colsep ,
set pagesize 120
set trimspool on
set headsep off
set linesize 1000
set numw

spool D: estmyfile.csv
select table_name, tablespace_name from all_tables;
spool off

View 2 Replies View Related

JVM :: Java Print API Shows Different Job Name On Printer Than In Spooling Queue

Sep 20, 2013

I am using Java print API (javax.print package) to send a bunch of documents for printing. Below is the code section that I am using to print documents through java program. When the document is sent for printing, I see the Job name is created properly in the print spooling queue on windows machine. But, when i go to the actual printer, the job name is different on the printer than what i saw in spooling. Since I am printing 100s of documents in batch, it gets very difficult to identify which document did not print, in case of issues.  I also used the java.awt.print package . The java.awt. print. PrinterJob has a method setJobName(String). When i used this package, I got the name appear properly in both places. But I wish to use javax.print with the document name appear on printer queue.    

public void printDocument(File pDoc, PrintService pService, DocFlavor pFlavor)   
throws Exception  {    logMessage(true, "Printing Doc::" + pDoc.getAbsolutePath());   
FileInputStream is = new FileInputStream(pDoc);    
// Create the print job    DocPrintJob job = pService.createPrintJob();    
//Set print request attributes with file name as job  
[code].....

View 0 Replies View Related

Client Tools :: Ignore Sql Prompt And Command Entered While Spooling?

Oct 24, 2011

Is it possible to ignore the sql command prompt and the command entered while spooling. I tried the to set echo off,term off and some more options but it did not work.

Example:

SQL> spool c: est.log
SQL> Prompt "This is a test"
"This is a test"
SQL> spool off;

The spool file has the following

SQL> Prompt "This is a test"
"This is a test"
SQL> spool off;

Is it possible to set some options so that the spool file only contains output.

"This is a test"

View 3 Replies View Related

SQL & PL/SQL :: Single Excel File For Emp Table Department Wise In Different Sheets Of Excel

Mar 30, 2012

I need to generate a single excel file which each department details in seperate sheets of the excel file, each sheet should ne named with department no (ex :Dept_10, Dept_20,Dept_30) and the main excel should be named as Emp_details.

Header row and total row should be in bold.I have created 3 individual excels thru toad and moved them to single excel and renamed the sheets.

Can we programatically do this thru SQL or PL/SQL, does Oracle provide any build packages for excel.As excel files cannot be uploaded,I am unable to upload the excel file I generated manually.

select to_char(empno) empno,ename,job,mgr,hiredate,
nvl(sal,0) sal,nvl(comm,0) comm,nvl(sal,0) + nvl(comm,0) "Total Income" ,deptno
from emp
where deptno = 10
union all
select 'Total',null,null,null,null,sum(nvl(sal,0)),sum(nvl(comm,0)),sum(nvl(sal,0))+sum(nvl(comm,0)),null
from emp
where deptno = 10;

View 1 Replies View Related

SQL & PL/SQL :: Compare Current Rows With Previous Rows

Apr 12, 2013

The Table having 3 columns

col0col1 , col2
P112
P112
P102
P113
P115

I want to retrieve the changes rows only.

Output like
col0col1 , col2
P112
P102
P113
P115

View 5 Replies View Related

PL/SQL :: Select 4 Rows And Then Next 4 Rows?

May 27, 2013

in my sql we can use limit to select first 4 rows in the table then next 4 rows ,can oracle do that ?

I have fifty rows inside the table

select * from student where rownum between 0 and 4 order by stuid ->it work

select * from student where rownum between 5 and 9 order by stuid -> did not work

what is the correct way to do it ?

View 10 Replies View Related

SQL & PL/SQL :: Subdivide Rows Into Rows

Apr 10, 2013

drop table test
/
create table test
(
lib varchar2(100)
)
/
insert into test values ('111/aaa/bbb/ccc');
insert into test values ('222/aaa/bbb/ccc');
insert into test values ('333+444/aaa/bbb/ccc');
insert into test values ('333/aaa/bbb/ccc');
insert into test values ('222+333+444/aaa/bbb/ccc');
insert into test values ('222+333+444+555/aaa/bbb/ccc');

I want to get this :

lib count
--------------- -----
111/aaa/bbb/ccc 1
222/aaa/bbb/ccc 3
333/aaa/bbb/ccc 4
444/aaa/bbb/ccc 3
555/aaa/bbb/ccc 1

View 4 Replies View Related

Upload Excel To 9i

Feb 15, 2004

i'm working with oracle 9i database fo my project. my questions are :

1)can we upload ms excel (.xsl) to oracle table. if yes, is it direct upload or we have to change it to .csv or other format ?

2)what are the tools to upload ms excel to oracle 9i?

View 5 Replies View Related

SQL & PL/SQL :: Excel Or CSV To Table?

Sep 13, 2011

I have an excel(csv) file which I can easily load to oracle table. But the challenge is how to manipulate it to make ease my final table.

CSV Format

STAFF_ID20032004200520062007200820092010
1 2 2 4 8 2 4 3 4
2 1 0 2 3 3 7 2 1 ..

and my desired oracle table below

STAFF_IDYEAR SCORE
1 20032
1 20042
1 20054
1 20068
1 20072
1 20084
1 20093
1 2010 4
2 20031
2 20040
2 20052
2 20063
2 20073
2 20087
2 20092
2 2010 1

The year WILL increase with time e.g 2011,2012.. etc So that defeats creating a loader with following script

'CREATE TABLE ext_IFP
( STAFF_ID varchar2(255)
,2003 varchar2(255)

[Code]....

View 1 Replies View Related

Delete 4 Millions Of Rows From A Table Having 25 Millions Of Rows?

Dec 14, 2007

I joined the forum just today, i need some tips on deleting the millions of rows from a huge table having 25 millions of rows.

View 4 Replies View Related

PL/SQL :: How To Transpose A Table From Rows To Columns Or Columns Into Rows

Aug 22, 2012

what are the collections available in Oracle Plsql, what are concepts of collection.

How to Transpose a Table from rows to columns or columns into rows.

DDL and DML concepts.

What is the concepts of statistics in Oracle Plsql.

View 4 Replies View Related

How To Automate A Data Into Excel

Dec 1, 2011

how to automate a data from oracle into excel...i have a table "emp" in oracle database now i need colums of emp ex:firstname ,last name, id from that table into excel.

so i need a script which when you schedule it it should create a excel file in particular postion,i was told we have to crete a directory from sql and using utl_file then we have to write a script and then schedule that.out look in excel should be

firstname lastname id
sam douglas 1
john - 2

View 1 Replies View Related

MS Excel As External Table

Sep 6, 2013

I need to do some analysis and research to find if any of these 8000 tables I have in a spreadheet that are going to be spit off into a separate database are used by any of our PeopleSoft processes.

I'm assigned to Student Records identified by NTSR.

So for table AAP_ETHNIC_PMPT, I could do something like

SELECT *
FROM PSSQLTEXTDEFN
where SQLID like 'NTSR%'
AND upper(sqltext) like '%PS_AAP_ETHNIC_PMPT%';

But how can I automate this and search 8000 rows in column A2 of a spreadsheet? What other tables other than PSSQLTEXTDEFN or PSPROJECTITEM can I use to search for values of NTSR?

View 1 Replies View Related

Excel Prepare Using PL/SQL Program?

Apr 26, 2012

in my plsql program(procedure) i have queries to fetch data from database. now i want to export those query results to an excel and store on my local machine drive path.

Here i don't want to use directory creation, how can i achieve this.

View 2 Replies View Related

SQL & PL/SQL :: How To Get Output In Excel Format

Nov 22, 2012

i need to extract data in excel file through sqlplus .

View 2 Replies View Related

Forms :: D2k 6i And Excel File?

Jun 23, 2010

I have generate a excel file through oracle developer 2000 6iwith password protect using OLE2 but autofilter,sort and format column options are not working.

PROCEDURE UnProtectCell(r NUMBER,c NUMBER) IS
BEGIN
args:= ole2.create_arglist;
ole2.add_arg(args, NumToRange(r, c));
XLRange:= ole2.get_obj_property worksheet, 'Range', args); ole2.destroy_arglist(args);

[code]...

View 6 Replies View Related

SQL & PL/SQL :: Reading From A Excel File

Dec 1, 2011

I am looking for a code/script to read values from excel file and perform PLSQL script.

Now i have the PLSQL script to generate report which takes two value which i have to change all the time to generate new report .All i wanna do create a script to read from a excel file and perform the other script.

I have been searching from a long time and only found UTL_file Package which use CREATE OR REPLACE FUNCTION and create some virtual table.

The problem is i don't have create authorization in database so i m not able to use UTL_File command . Is there any simple way to read value from excel file?

View 16 Replies View Related

SQL & PL/SQL :: Email With Excel Attachment

Aug 4, 2011

I need the pl/sql procedure that sends email with excel attachment using utl_smtp.The email procedure should take the excel attachment file from my local directory.

View 6 Replies View Related

SQL & PL/SQL :: Query Result Into Excel Or CSV

Jun 15, 2011

I have a sql query which fetch the data from 4 different tables. I want to write the output of that query into a excel or a CSV file without using TOad and all. Let me know is it possible via creating function or procedure.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved