Formatting excel generated from PL/SQL
HelloMy requirement is to generate an excel from PL/SQL, which I was able to do in the code next Sanjeev. I was able to generate an excel, but the data in the cells were all in the format 'general' I want to date formatted as currency as "currency" and "date".
I have looked further and landed on the piece of code following
< cell > < data ss:Type = "DateTime" > 1928-06-25 T 00: 00:00.000 < / Data > < / cell >
But even this was not useful.
Can someone help me with this? Can this be achieved?
Thank you
Murali
Hello Murali,
I don't know if the Sanjeevs package allows a custom cell formatting, but you can use others like
https://XML-spreadsheet.SampleCode.Oracle.com/ or
https://exceldocumenttype.SampleCode.Oracle.com/
Concerning
Marcus
Tags: Database
Similar Questions
-
How to allow a user to download a custom report generated from pl/sql?
Hello
I am putting together my first app APEX (v 3.1.2.00.02) and I have a requirement that I am not completely sure that the implementation.
Basically, I have a page where the user can select a set of buildings that they validate. Buildings have an x, ordered as SDO_GEOMETRY and a few other attributes. For now, they select from a dropdown list and I run a SQL query that performs validation and I present the results in a table of Standard report. That everything is perfect.
Now, there is a requirement to the release of the results of the report in another text running format (called a consultation file), with another desktop application can consume to direct the user to the buildings that need to be corrected. I've included an example of this output below.
I so want to see the existing Standard report table and also have a link to download the file in. I can use a stored procedure to write output to the file of consultation, but I don't know how it is available for download.
I could use UTL_FILE to write the browse file to a location on the server, but then I don't know what to do next.
I'll have a look at the download section of file of the [the server HTTP mod_plsql User Guide | http://download.oracle.com/docs/cd/B19306_01/server.102/b14337/concept.htm#i1005866] but before we get too deep into it, I wanted to check if anyone has any better ideas how this implementation.
Any help would be appreciated,
Reggie
The format of file browse will be as follows:BROWSE VERSION 1.0 ELEMENT TAG "INPUT PARAMETERS" COMMENT "REVIEW operation executed on SAMPLE_BUILDINGS" COMMENT "4 elements logged from SAMPLE_BUILDINGS" ELEMENT TAG "ERROR" COMMENT "Building Point Outside Polygon" LOCATION 674444.431 696112.632 ELEMENT TAG "ERROR" COMMENT "Building Point Overlaps Road" LOCATION 675419.950 697391.195 ELEMENT TAG "ERROR" COMMENT "Duplicate Building Point" LOCATION 674205.041 697364.946 ELEMENT TAG "ERROR" COMMENT "Building Point with no Address" LOCATION 675215.807 697178.701 {code}
You can use a procedure like this to allow a download of your file stored as a bfile type (in a directory):
PROCEDURE download_bfile ( file_in IN VARCHAR2 DEFAULT 'test.txt', directory_in IN VARCHAR2 DEFAULT 'DATA_PUMP' ) AS lob_loc BFILE; v_mime VARCHAR2 (48) DEFAULT 'application/txt'; v_length NUMBER; BEGIN lob_loc := BFILENAME (directory_in, file_in); v_length := DBMS_LOB.getlength (lob_loc); OWA_UTIL.mime_header (NVL (v_mime, 'application/octet'), FALSE); HTP.p ('Content-length: ' || v_length); HTP.p ( 'Content-Disposition: attachment; filename="' || SUBSTR (file_in, INSTR (file_in, '/') + 1) || '"' ); OWA_UTIL.http_header_close; WPG_DOCLOAD.download_file (lob_loc); END download_bfile;
To perform this procedure of work of the Summit, you can use approach similar to the following:
http://Apex.Oracle.com/pls/OTN/f?p=31517:15
You can also have a look at this thread:
Re: Need help with the analysis of a Blob in a Table
It will give you lots of ideas how this problem could be solved.
Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------- -
convert the data in the Format of Date imported from MS SQL Server.
I imported data from MS SQL Server. The column 'Date' received in digital format as 41017.6361109954. How can I convert Date in Oracle SQL.
If I import the same data in Excel and you change the Type of column to this day. He passes. But in Oracle, I tried the To_Date function with different parameters, but it did not work.
Published by: XAVER 22 April 2012 02:31select timestamp '1970-01-01 00:00:00' + numtodsinterval(41017.6361109954,'day') from dual; TIMESTAMP'1970-01-0100:00:00'+NUMTODSINTERVAL(41017.6361109954,'DAY') --------------------------------------------------------------------------- 20-APR-82 03.15.59.990002560 PM SQL>
SY.
-
Export data in Excel from pl/sql
can someone please give me some code examples on how to export data from pl/sql to excelNo, it's the problem. Oracle is unable to see the client directories (and it shouldn't). UTL_FILE works only in the directories of the server.
Concerning
Marcus -
Hey guys,.
I'm using version 4.2.6 apex. The theme is 26.
IM also using Listener Oracle APEX.
I can print my classic report in PDF or CSV format.
But I need to export it as a .xls extension.
Report type: SQL (body of function from PL/SQL returning the SQL) query
I need is like this cause my 'where' clause type is dynamic.
Look at using this method: Tom's Blog: a non-standard export excel 2010 (.xlsx)
I do something similar for downloads to excel in my projects...
Thank you
Tony Miller
Software LuvMuffin
Ruckersville, WILL -
confusion on the stats from v$ sql
I'm trying to increase the performance of a quarter of the exadata machine rack and uses the table v$ sql to see what questions the front-end application is generating (done automatically) and sending it to oracle. I question the table v$ sql like this:
select sql_id, io_cell_offload_eligible_bytes qualifying, io_cell_offload_returned_bytes actual, round(((io_cell_offload_eligible_bytes - io_cell_offload_returned_bytes)/nullif(io_cell_offload_eligible_bytes,0))*100, 2) io_saved_pct, elapsed_time/1000000, first_load_time, application_wait_time/1000000, concurrency_wait_time/1000000, user_io_wait_time/1000000, plsql_exec_time/1000000, java_exec_time/1000000, cpu_time/1000000, rows_processed, sql_fulltext, sql_text from v$sql where io_cell_offload_returned_bytes > 0 and instr(sql_text, 'D1') > 0 and parsing_schema_name = 'DMSN' order by --(round(((io_cell_offload_eligible_bytes - io_cell_offload_returned_bytes)/nullif(io_cell_offload_eligible_bytes,0))*100, 2)) asc elapsed_time/1000000 DESC
Whats confusing for me, is that I see a row of the table like this:
SQL_ID QUALIFYING STAGE REAL IO_SAVED_PCT ELAPSED_TIME/1000000 FIRST_LOAD_TIME APPLICATION_WAIT_TIME/1000000 CONCURRENCY_WAIT_TIME/1000000 USER_IO_WAIT_TIME/1000000 PLSQL_EXEC_TIME/1000000 JAVA_EXEC_TIME/1000000 CPU_TIME/1000000 ROWS_PROCESSED SQL_FULLTEXT bvmtg9n1bss3r 181485174784 120788774976 33.44 5168.205681 2013-07-26/11: 42:53 5.481132 0.113112 3773.585818 0 0 1429.028 102401297 (HUGECLOB) 44y4dvhb12zc0 330356482048 110817408 99.97 3472.110958 2013-07-29/10: 11:35 2.359406 0.128388 3447.086174 0 0 21.973 275 (HUGECLOB) fssqzqq0tsffq 428624363520 7205116688 98,32 3099.086997 2013-07-20: 20: 51:28 0.058573 0.073064 2686.077653 0 0 361.081 40107806 (HUGECLOB) gyy3tk70t5h69 83012501504 70481653440 15.1 3050.021479 2013-08-01/10: 49:44 2.661973 0.000609 279.596557 0 0 2942.207 43649621 (HUGECLOB) fxazp767kzcan 3645325312 6389645208 -75.28 1477.232161 2013-08-05-09: 17:14 0.080002 0.000268 1374.649241 0 0 83.69 754293 (HUGECLOB) 0229k7cwq33aq 51346874368 3062262552 94.04 804.351766 2013-08-02/16: 01:34 1.880049 0,0019 693.156814 0 0 108.625 2005797 (HUGECLOB) the elapsed times are very long and my understanding is that it is the operating time from end to end for queries, is that correct.
But when I run these queries into a toad, the results come back in about a minute or two.
I have also noticed that most of the time is divided between USER_IO_WAIT_TIME and CPU_TIME, I think I understand what is CPU_TIME, but I wasn't quite able to understand what USER_IO_WAIT_TIME is the online documentation.
My question is, the elapsed time is really the end of the query execution time? If so, why do I see CBI? genetically different times when run the queries in Toad manually?
SELECT ELAPSED_TIME/EXECUTIONS AVG IN V$ SQL;
because elapsed_time is a cumulative value
-
Very CONFUSED about invalidation and last_load_time from v$ sql.
Hi all.
I'm very confused on the definitions of column of v$ sql.
The oracle is envirenment 10.2.0.4 RAC 3-node.
The following comes from gv$ sql.
--------------
INST_ID select sql_id, child_number out.
hash_value, plan_hash_value,
first_load_time, last_load_time, loads, invalidations
SGS $ t sql
where 1 = 1
and sql_id = "5hnvqby4tyvt9."
/
1 5hnvqby4tyvt9 0 2308927273 1898129466 2011-07-17/07: 45:00 2011-07-17/07: 45:00 1-0
2 5hnvqby4tyvt9 0 2308927273 1898129466 2011-07-17/07: 51:18 2011-07-25/06: 9 1 30:07
---------------
1. no changes are object-definition related to the tables in the query of '5hnvqby4tyvt9 '.
2. currently, the sql in the nodes 1 and 2 has the same PLAN_HASH_VALUE.
3. in nodes 1 and 2, the sql has been loaded in the library cache,
2011-07-17/07: 45:00 and 2011-07-17/07: 51:18 respectively.
4. However, last_load_time differs from the other.
-the node 1: last_load_time is ' 2011-07-17/07: 45:00 ' and invalidations is 0.
-node 2: last_load_time's ' 2011-07-25/06: 30:07 ' and invalidations is 9.
---------------
My question is:
1. What is the difference in last_load_time between node 1 and node 2?
2. What is the difference made in disqualifications between node 1 and node 2?
3 I know, that when it changed the definition of table, sql cursor becomes invalid.
However, there was no change in the definitions of the query table.
What could make a child cursor in the cache library not valid?
4. According to the manual of oracle
(http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2113.htm#REFRN30246),
LAST_LOAD_TIME means 'time in which the query plan (memory segment 6) has been loaded in the library cache'
However, the plan_hash_value 1-node and node-2 has the same value,
even if the child in node-2 sql cursor has been re-charge 9 times since the first loading in the library cache.
What it means?
------
Thanks in advance.
Best regards.869578 wrote:
parts of the cursor (mainly the lot 6, the execution plan) can age due to pressure of space
When 'PARTS' of a cursor has become aged because of the pressure of space,
It increases the number of invalidation count(v$sql)?Yes.
In addition, in the case above (parts of a cursor have become aged because of the pressure of space in the library cache),
the update of last_load_time(v$sql) does not always mean "sql plan of change."Is this good?
Hmmm, let me think for a moment. I think it's always true when we see invalidations, it's the SQL Plan, which has been invalidated. This is not to say that the plan changed, however. You could get a plan struck down for trivial reasons, say, a grant or revoke them on a table. After that, on reload, the plan that is generated can be identical to the regime that had just been invalidated.
Hope that helps,
-Mark
-
Footers that disappears into the PDF generated from FrameMaker 9
Three other writers and I are having a problem with feet disappearing into FrameMaker. Here's the problem: in FrameMaker, footers appears correctly. When convert us a book in PDF format, many of footers disappear. We find that a footer (or a part of the footer) appears on the first page of the chapter, but then footers disappear in the rest of the chapter.
Here is some info:
·
We use the frame 9. My version is 9.0p250. I also use Adobe Acrobat 9 Pro Extended, Version 9.3.2 and Adobe Distiller: Professional Version 8.1.3
· We have been able to reproduce this problem by using several guides.
· Oddly, footers appear correctly when I print a single chapter.
· I tried to restart my machine and then only FrameMaker loaded (if memory problems).
· I optimized the book file and associated chapters.
· I experimented with different settings distill.
Does anyone else have this problem?
It is probably a symptom of the MS Hotfix that corrects a problem with the text in PDF documents endangered generated from several Windows applications (not just FM).
More info here:
Adobe blog: hotfix for FrameMaker
Please let us know if this is the case-
Sheila
-
SQL (body of function from PL/SQL returning the SQL) query when you use to_char
We are trying to build a page of Type SQL Query report (body of function from PL/SQL returning SQL query).
our request is simple, to extract the month of the column recording_date.
declare
l_query varchar2 (1000);
Start
l_query: = 'select to_char (recording_date, 'MM') of re_productive;
Return l_query;
end;
but we would like the following for this query problem
Function returning SQL query: query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the box of generic columns below the source of the region without analysis.
(ORA-06550: line 4, column 42: PLS-00103: encountered the symbol "MY" what awaits one of the following values:.) (* @ % & = - +; <>/ at is mod remains not rem <>or! = or ~ = > = < = <>and or as between | multiset Member SUBMULTISET_ the symbol ".") was inserted before 'MY' to continue.)
Notes:
1 - the request is correct and it has been tested under sqlplus and toad.
2. we tried option use generic name (analysis of query runtime only) column, but we get the same problem.
any quick help please.Hello
You have not escaped your quote in the string. Try this...
DECLARE l_query VARCHAR2(32767); BEGIN l_query:= 'select to_char(recording_date,''MM'') from re_productive'; RETURN l_query; END;
See you soon
Ben
-
I was working on a doc Excel, open from my email account, I forgot to save the file on my desktop where the original file was. I kept while I was working, so where my file went? saved on my profile Inbox or where? Please I need for my work, tonight. Help!
Hi MelanieCline-Thera,
Please take a look at a similar thread (substitute just Word for Excel):
-
Original title: No Audio device
So I just formatted my computer from ubuntu and Windows xp installed. And now I have no sound. It says "No. Audio Device. My integrated sound card is broken and so I 'card his Creative Labs SB0220. I search for hours but couln can't find any solution.
Hi Sannukas0016,
Follow the suggestions below for a possible solution:
Method 1: Run the fix it from the link below and check if this can help:
Diagnose and automatically repair audio playback problems
http://support.Microsoft.com/mats/NO_SOUND/en-us
Method 2: You can also try the steps from the link below:
There is no Audio playback after you install the Sound Blaster Live! Sound card
http://support.Microsoft.com/kb/313022
Hope this information helps.
-
Lost everything of major problems - AutoFormat - lost Boot Manager!
After that formatting machine - loaded from CD - recovery of language system, etc. - repair pc - nothing in there changed no bones no partitions not location - request if you do not see the bones click on download drivers for hard drive - those who? help please
If you have formatted your drive, there is nothing. You will need to do a clean install of vista.
-
Have windows 7 64 bit, andf Intuit quickbooks pro, Amyuni PDF printer will not save to the PDF format. Message from readings of intuit library printers 'could not print to the printer. Check your printer selection. Impression was canced from another program.
Hi rkusa1,
Thank you for using Microsoft Windows forum
QuickBooks worked very well under Vista? It should also work reliably on Windows 7.
However, you may want to follow these steps.
1. right click on your quickbooks start exe file and open properties.
2. on the Compatibility tab, select the compatibility mode and run this program in compatibility mode for Windows using the following link: http://windows.microsoft.com/en-us/windows7/Make-older-programs-run-in-this-version-of-Windows (only if she worked very well with former Windows operating system)
3. the control privilege level "Run this program as Administrator". Press apply/OK to close properties.
4. start - devices and printers - add a printer - add a local printer - create a new port - local port and name it QBD_PDF.
5. Choose install AMYUNI Technologies - Amyuni Document Converter 300 (click the button update windows if it is not on your list).
6. If windows detects you already have a driver and then choose to replace the current driver. The printer name Quickbooks PDF Converter - do not share the printer - NOT set as the default printer. Finishing
7. start right click - devices and printers - printer QB, choose printer - properties and go to the Advanced tab.
8. remove the checkmarks in the 4 elements with square next to them (lower part of the screen) boxes, and then select "Print directly to the printer" press OK to close the window.
9 restart you computer and open Quickbooks. Open the file - printer installation and make sure of Quickbooks PDF Converter is selected for any operation PDF printer that you use frequently. (on rare occasions, you will see not of Quickbooks PDF Converter on the list, reboot again and you'll get it).
You can now perform operations of PDF in Quickbooks (works for 32 and 64-bit Windows 7)
For a similar question, see: http://social.technet.microsoft.com/Forums/en/w7itproappcompat/thread/2bd30024-0a64-4f6b-a831-8cb7c1e4cce5
If the steps above do not post your question in this link: http://community.intuit.com/quickbooks
Kind regards
Aziz Nadeem - Microsoft Support -
Hi all
We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.
How to get the selected line in a programmatic (using a SortableModel custom not a display object) ADF table (generated from a bean)?
We are trying to get the selected row in a bean of a programmatic ADF table to retrieve data based on the selected line.
Any idea?
Well, you can use selectionListener to set the selected line to a variable of bean (but this bean must be in extended view or some superiors)
Something like this: http://www.awasthiashish.com/2015/07/get-selected-row-singlemultiple-from.html
Dario
-
How to display '-1' with a table not formatted (Excel spreadsheet) in InDesign
Hello!
If you place a table not formatted (Excel spreadsheet) in the cells of InDesign with '-1' are not displayed :-(
The Adobe solution is to use the tables formatted, but that is no option for us, because if the numbers in the excel worksheet updated, InDesign loses real formatting and rebuilt the Excel formatting :/
The problem is understandable for Adobe, but we didn't have the suspicion to ask in the forum for a solution.
I think the problem is the operating system and independent version of InDesign - we everywhere (Windows 7,8,10) and Mac OS X, CS6 CC problem - there is a bug/feature in constand.
Does anyone have a solution or a solution to our problem? :-)
Thank you in advance!
Ludwig
In Excel, you must precede the - 1 with an apostrophe (so '-1). As you probably know, this is unnecessary with other negative numbers... If I remember correctly.
It is not sufficient for formatting just these cells as text in Excel, the apostrophe is necessary.
Mike
Maybe you are looking for
-
My question says it all. I click on the new tab button and nothing opens. By clicking on the links will open a new tab, if necessary, or using "Open in new tab" seems to work very well.
-
When I try to bookmark a new page, I don't get the window of "Page bookmarked or edit this bookmark. I t place the site in my favorites, but I have to go to "organize" bookmarks in order to put it where it belongs.
-
Invisible BootCamp partition, I can't access or delete!
So to start with, I try to install 10 Windows from a USB on my computer with bootcamp (I use OS X elcappitan). So, I followed the normal steps for installing windows via bootcamp 10 as get the iso file on my usb key (which is 8 GB) and make the score
-
Hello! This seems to be a fairly common problem, but after extensive research on the web and endless trials and errors I can still fix my problem! It makes me crazy! No pun intended. I have re-installed... restarted... reset... and I'm tired. I have
-
HP Color LaserJet CP3505n: 3505 printer fuser error
I have a fuser error 50.9 and followed all the troubleshooting steps. Still no luck. Will need to take to repair Monday, but want to make sure I did everything what I can here before. Very frustrating.