Quantcast
Channel: Comments on: Create an Excel-file with PL/SQL
Viewing all 73 articles
Browse latest View live

By: Robertson

$
0
0

Hi Anton,

While exporting 73220 rows, i am getting below error message.

“ORA-04030: out of process memory when trying to allocate 16328 bytes (koh-kghu call ,pmucpcon: tds)
ORA-04030: out of process memory when trying to allocate 16328 bytes (koh-kghu call ,pmucalm coll)”.

I think , you package causes excessive allocations of process memory space.

Please help me.


By: Anton Scheffer

$
0
0

What kind of help do you expect? On my 11 XE database the package produces a 73220 rows, with 10 numerical columns, Excel file without a problem in 10 seconds. If I change it to use 2 string columns of size 100 it still works OK. So my guess is that you are using a lot of very large strings on a 10 (XE) database. And it looks like the package isn’t suitable for that. What should I do? Keep guessing and change the package and hope for better results? Build in a limit to restrict the package to generate max 5000 rows so people don’t allocate to much memory?

By: tony miller

$
0
0

Anton,
I would say people need to understand you provided a FREE package to be used and they take their OWN risks in using it.. Shesh, you went out of your way to provide the package and we are using it to produce Office 2003 files with some special formatting..

We are VERY Thankful for what you provided, and what Denes provided (a package to grab the current select for an Interactive report with bind variables dealt with properly… Yes, it has some issues with returning extra columns with the select due to the way interactive reports re-write the query you build for a report.

But we appreciate someone else contributed this to the community with NOT strings attached (beyond a thank you or a possible contribution to keeping their site up and running..)

By: mrbrightwork

$
0
0

Anton,

Great work. Thank you for posting your tool. Your as_pdf3 tool uses dbms_lob.freetemporary when you do a save. Is there any reason to avoid freeing the blob when doing a save in as_xlsx?

Thanks,
Ted

By: Anton Scheffer

$
0
0

No reason, I thought that as soon the used blob went out of scope (i.e. after the call to finish) it is freed automatically.

By: Albain DSM

$
0
0

Works even better w/ autoflush ;-)

utl_file.put_raw( file => t_fh
, buffer => dbms_lob.substr( p_blob
, t_len
, i * t_len + 1
)
, autoflush => true
);

By: Anton Scheffer

$
0
0

I must say I never had any problems without the autoflush = true. But you are right, it’s better. And if you have trouble writing out a file, it might even help to add max_linesize => 32767 to the utl_file.fopen statement.

By: Newbie

$
0
0

Hello Anton,

I’ve been using your pl/sql package to create an excel file. It works great !!!
I have two questions. How do I rename the sheets (ie. Sheet1) and how can I create a excel document with multiple sheets within the same excel document? Below is what I’m trying to attempt. When I run the following query, the output file is created but when I try to open the file with excel I get multiple errors.

DECLARE

v_dir VARCHAR2(30) := Course_dir;
v_file VARCHAR2(30) := ‘my_course.xls’;

begin
pwg_create_xlsx.clear_workbook;
pwg_create_xlsx.new_sheet(‘Course 24967′);
pwg_create_xlsx.query2sheet(‘select * from courses where course_numb = 24967′ );
pwg_create_xlsx.new_sheet(‘Course 24293′);
pwg_create_xlsx.query2sheet(‘select * from courses where course_numb = 24293′ );
pwg_create_xlsx.save(v_dir, v_file);
end;


By: Anton Scheffer

$
0
0

@Newbie. Any reason why you renamed the package?
Use the parameter p_sheet, for instance
pwg_create_xlsx.query2sheet(‘select * from courses where course_numb = 24967′, p_sheet => 2 );

By: Newbie

$
0
0

Hello Anton,
Thank you for the update. The package was renamed to match or naming standards. This is only for testing. How can I change the font on the entire sheet and how can I specify the column widths? Can each column have its own column width?

Newbie.

By: Bala

$
0
0

I ran below code, and it generated the file successfully.
But I could not open the file, when I tried it throws an error message “Excel found unreable content in ‘my.xlsx’”

begin
as_xlsx.new_sheet( ‘query 1′ );
as_xlsx.query2sheet( ‘select 1 r from dual’, p_sheet => 1 );
as_xlsx.new_sheet( ‘query 2′ );
as_xlsx.query2sheet( ‘select 2 r from dual’, true, ‘ETF_DATA_OUT_DIR’, ‘my.xlsx’, 2 );
end;

By: Anton Scheffer

$
0
0

That code works for me. And it will probably work for you too if you try it in a new session.
If you start your code with as_xlsx.clear_workbook;
you make sure that you start with a “clean” excel file.

By: Boydus

$
0
0

This is really good. Is there an alternative for doing the xls files?

By: Anton Scheffer

By: Pinta

$
0
0

Hi Anton,

Great Package…

I wanted to have different font-size and Font-Color on the title – Few Merged Cells…
I am able to do it it in XML …

Just wanted to know if I could do somekind of HTML Format implementation… Similar to the following…
which works in XML –> Excel…

as_xlsx.cell( 1, 1, ‘Title - SubTitle‘);

Currently it treats them as text.. in you procedure…

as_xlsx.mergecells( 1, 1, 20, 1 )


By: Pinta

$
0
0
<B>Title</B>'|| '<B>- SubTitle</B>')

By: Anton Scheffer

$
0
0

You could try
as_xlsx.cell( 1, 2, ‘Title- SubTitle’, p_fontId => as_xlsx.get_font( ‘calibri’, 2, 15, p_bold =>true ) );

By: Pinta

$
0
0

Hi Anton,

thanks for the Quick Response..

What Ment was –>
Tiltle using ‘calibri’ 15, p_bold =>true
SubTitle using ‘calibari’ 15, bold=>false
both in the same cell

I tried in 2 different cells (works) but then merging them gets ris of the second cell

Wonderful Package, and I love it!

Thanks A lot in Advance!

By: Dheeraj

$
0
0

This package has been very helpful to me. In one of the reply below you had said “Build in a limit to restrict the package to generate max 5000 rows so people don’t allocate to much memory?” Could you please point where this limit is set in the package? I am running into an odd situation where it only creates 200 rows in the Excel file whereas the table has 514 rows. My table has 4 clob type columns. If the table has clob type column, do I need to covert the columns into string or varchar2 type before calling the Query2Sheet?

By: Ramkumar

$
0
0

i hope someone can help me about the date system too, im using windows, i have an extracted excel and after copying its cell in date format into another excel file, the date becomes different. this is excel’s issue “1904 / 1900″, is there a way that we set the package to just be in 1900? your help is appreciated. Thanks!

Viewing all 73 articles
Browse latest View live