PL SQL output XML
Hi all
Pl sql, I need to export data in XML format. I can do the basic stuff, but I can't find a way to get the result in the following format
< m:Order OrderNumber = "123456" Status = "NO_DATA" / >
The format is valid xml as XML Notepad shows correctly, but I can't find a way to do it in pl sql
Thank you
with t as)
Select OrderNumber 123456, "NO_DATA" status of double
)
Select xmlelement ("m:Order", XMLATTRIBUTES (OrderNumber as "OrderNumber", "Status" status))
t
/
XMLELEMENT ("M:ORDER",XMLATTRIBUTES(ORDERNUMBERAS"ORDERNUMBER",STATUSAS"STATUS"))
--------------------------------------------------------------------------------
SQL >
SY.
Tags: Database
Similar Questions
-
Hi all
Please find test data and results as XML and SQL output.
Version : Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
create table emp_xml (empno number, emp_name varchar2 (100), by e-mail to varchar2 (100));
insert into emp_xml values (100, 'DAVID',' [email protected]');
insert into emp_xml values (101, 'ROBERT',' [email protected]');
insert into emp_xml values (102, 'DANIEL',' [email protected]');
CREATE table emp_dept_xml (empno number, dept_list varchar2 (4000));
insert into emp_dept_xml values (' 100,'10, 20, 30, ");
insert into emp_dept_xml values (' 101,'40, 20, 10, 30, 50, ");
insert into emp_dept_xml values (102, ' 10'),
Expected in SQL output
-----------------------
EMPNO EMP_NAME EMAIL DEPTNO
DAVID 100 [email protected] 10
DAVID 100 [email protected] 20
DAVID 100 [email protected] 30
ROBERT 101 [email protected] 10
ROBERT 101 [email protected] 20
ROBERT 101 [email protected] 30
ROBERT 101 [email protected] 40
ROBERT 101 [email protected] 50
DANIEL 102 [email protected] 10
Results in XML
-----------------------
< USERS_DETAILS >
< USER >
< EMPNO > 100 < / EMPNO >
DAVID < NAME > < / NAME >
< EMAIL > [email protected] < / EMAIL >
< ASSIGNED_DEPT >
< DEPT > 10 < / DEPT >
< DEPT > 20 < / DEPT >
< DEPT > 30 < / DEPT >
< / ASSIGNED_DEPT >
< / USER >
< USER >
101/EMPNO < EMPNO > >
ROBERT < NAME > < / NAME >
< EMAIL > [email protected] < / EMAIL >
< ASSIGNED_DEPT >
< DEPT > 10 < / DEPT >
< DEPT > 20 < / DEPT >
< DEPT > 30 < / DEPT >
< DEPT > 40 < / DEPT >
< DEPT > 50 < / DEPT >
< / ASSIGNED_DEPT >
< / USER >
< USER >
< > 102 EMPNO < / EMPNO >
DANIEL < NAME > < / NAME >
< EMAIL > [email protected] < / EMAIL >
< ASSIGNED_DEPT >
< DEPT > 10 < / DEPT >
< / ASSIGNED_DEPT >
< / USER >
< / USERS_DETAILS >
Thank you
Rambeau
SQL> select e.empno 2 , e.emp_name 3 , e.email 4 , regexp_substr(d.dept_list, '[^,]+', 1, level) deptno 5 from emp_xml e 6 join emp_dept_xml d 7 on e.empno = d.empno 8 connect 9 by level <= length(d.dept_list) - length(replace(dept_list, ',')) 10 and prior e.empno = e.empno 11 and prior dbms_random.value() is not null; EMPNO EMP_NAME EMAIL DEPTNO ---------- -------------------- -------------------- -------------------- 100 DAVID [email protected] 10 100 DAVID [email protected] 20 100 DAVID [email protected] 30 101 ROBERT [email protected] 40 101 ROBERT [email protected] 20 101 ROBERT [email protected] 10 101 ROBERT [email protected] 30 101 ROBERT [email protected] 50 102 DANIEL [email protected] 10 9 rows selected. SQL> select xmlelement 2 ( 3 "USERS_DETAILS" 4 , xmlagg(xmlelement 5 ( 6 "USER" 7 , xmlelement("EMPNO", empno) 8 , xmlelement("NAME", emp_name) 9 , xmlelement("ASSIGNED_DEPT", xmlagg(xmlelement("DEPT", deptno))) 10 )) 11 ).extract('*') xml_output 12 from ( 13 select e.empno 14 , e.emp_name 15 , e.email 16 , regexp_substr(d.dept_list, '[^,]+', 1, level) deptno 17 from emp_xml e 18 join emp_dept_xml d 19 on e.empno = d.empno 20 connect 21 by level <= length(d.dept_list) - length(replace(dept_list, ',')) 22 and prior e.empno = e.empno 23 and prior dbms_random.value() is not null 24 ) 25 group 26 by empno 27 , emp_name; XML_OUTPUT --------------------------------------------------------------------------------
100 DAVID 10 20 30 101 ROBERT 40 50 30 20 10 102 DANIEL 10 -
Conversion of XML output SQL output
Hello
How to convert the result of the SQL query in XML format? Pl help.
Thank you
ManoYou use DBMS_XMLGEN, you can generate the output XML form.
SQL> SELECT * FROM CUSTOMER; C D1 D2 -- ---------- ---------- c1 01/04/2009 01/04/2009 c2 01/04/2009 02/04/2009 c3 01/04/2009 02/04/2009 c4 01/04/2009 02/04/2009 SQL> select dbms_xmlgen.getxml('select c,d1,d2 from customer') xml FROM DUAL; XML --------------------------------------------------------------------------------
c1 01/04/2009 01 SQL> Other means, also refer
http://www.stylusstudio.com/sqlxml_tutorial.html -
Hello
I am beginner in XML, all points and references will help me greatly. I need to generate pl/sql xml output and validate data output against xml schema xml. Output XML contains a lot of child with them tags and tags parent. I may not be able to use dbms_xmlgen, because I have to put several tags with DBMS_XMLGEN.setRowTag.
I enclose part of my xml output to get an idea.
ITST:OrganizationName > a < / itst:OrganizationName >
< oes:LookupDateTime > 2001-12-17 T 09: 30:47Z < / oes:LookupDateTime >
< itst:SerialNumberIdentifier > 0 < / itst:SerialNumberIdentifier >
< itst:SubscriptionListOfficialOnlyIndicator > true < / itst:SubscriptionListOfficialOnlyIndicator >
< itst:SubscriptionListCompleteIndicator > true < / itst:SubscriptionListCompleteIndicator >
-< itst:TelephoneSubscriptionCollection >
-< itst:TelephoneSubscription >
-< itst:TelephoneSubscriber >
< itst:AnonymousPrepaidIndicator > true < / itst:AnonymousPrepaidIndicator >
-< itst2:PersonNameStructure >
< dkcc:PersonGivenName > one < / dkcc:PersonGivenName >
< dkcc:PersonMiddleName > one < / dkcc:PersonMiddleName >
< dkcc:PersonSurnameName > one < / dkcc:PersonSurnameName >
< itst:EmploymentPositionName > one < / itst:EmploymentPositionName >
-< itst:TelephoneSubscriptionAddress >
-< xkom:AddressComplete >
-xkom - 2:AddressAccess >
< MunicipalityCode > 0000 < / MunicipalityCode >
< StreetCode > 0000 < / StreetCode >
< dkcc:StreetBuildingIdentifier > 1 < / dkcc:StreetBuildingIdentifier >
< / xkom - 2:AddressAccess >
-< xkom:AddressPostal >
< dkcc:MailDeliverySublocationIdentifier > one < / dkcc:MailDeliverySublocationIdentifier >
< dkcc2005:StreetName > one < / dkcc2005:StreetName >
< StreetNameForAddressingName > one < / StreetNameForAddressingName >
< dkcc:StreetBuildingIdentifier > 1 < / dkcc:StreetBuildingIdentifier >
< dkcc:FloorIdentifier > 1 < / dkcc:FloorIdentifier >
< dkcc:SuiteIdentifier > one < / dkcc:SuiteIdentifier >
< dkcc2005:DistrictSubdivisionIdentifier > one < / dkcc2005:DistrictSubdivisionIdentifier >
< dkcc2005 - 2:PostOfficeBoxIdentifier > 1 < / dkcc2005 - 2:PostOfficeBoxIdentifier >
< dkcc2005:PostCodeIdentifier > 0000 < / dkcc2005:PostCodeIdentifier >
< dkcc2005:DistrictName > one < / dkcc2005:DistrictName >
< dkcc:CountryIdentificationCode scheme = 'iso3166-alpha2' > < / dkcc:CountryIdentificationCode >
Please suggest me how I can generate xml output in these way of pl/sql.
Thank you
RambeauLook at the features of SQL/XML, XMLElement, XMLForest, XMLAgg, etc. to generate your XML code. It will probably take a big SQL account to your sample, but it will be flexible. Regarding validation, see the FAQ on this forum.
-
Failed to retrieve input or output XML for a BP
Hello
Unfier 10.1 running. Logged as administrator. After the opening of a company under uDesigner/Business process, select a BP. In the menu select integration. When we try to recover the input or output XML, we get an empty document of 0 bytes. The entry CSV Template shows to the menu option and XLS document with data.
Anyone encountered this?
Thank you
Rudy
Solved.
I logged in as a user with Admin privileges, then changed to user mode Admin open the workspace under uDesigner and company I can export documents of integration with success.
-
Output XML code directly will open in the browser
Hello
I use OAS 10g R2. We are generates all the reports with the PDF output directly in the browser. For some of them, we implemented exit Excel, but it does not work very well. After that, we deployed out Excel through Rep2Excel but has too many problems.
Finally, we opted to generate reports with the output XML, using DesFormat = XML and DesType = CACHE. We want this release to be opened directly in Microsoft Excel, but browsers (Firefox or IE) that open directly so that users must save the output in an XML file and then open it with Excel.
We know some so that the output can be directed to Excel without this extra step?
Thank you!Hello
You can test to use the mimetype parameter:
http://www.Oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/Cmdline/common/cla_mimetype.htm
Concerning
-
I hope this is the right forum to post. I was wondering if there is any good tutorials or books on SQL in XML format?
Basically, I need to interrogate the accounts of North Carolina who received a document given in the past day. This is a very easy task to do, in SQL, however, the State of North Carolina wants us to share our findings in a specific XML schema using nodes.
Fortunately, I have the pattern that was given by the State of NC but don't know how to get my application to fit in the XML schema. I was wondering in a beginners perspective.
Sorry for the newbie questions.The [DB XML Forum | http://forums.oracle.com/forums/thread.jspa?threadID=410714&tstart=0] is a good starting point.
-
OBIEE-write delayed enactment of PL/SQL in XML
Hi all
Thank you very much D info was really helpful, but in my database, I need to take into account the exceptions so I was wondering if I could use PL/SQL with XML in the writeback... ??? If Possible can u give an example XML wid THAT PL/SQL for UPDATE/INSERT Write Back in OBIEE because we have few exceptions to be managed during writeback is made...
I would really Appreicate it. Thanks in advance... For example... lke if something = 0 value is given to do the B value, which depends on A zero... otherwise it should work in normal proportion... for this I need to PL/SQL
Concerning
JeffroyIt seems to be a typo in your (missing) declaration; check using sqlplus and toad.
BEGIN
IF '13' > 10 THEN
UPDATE DAILY.test_p SET A = ('13' + 5), B = '1 ', '13' + '1' = C, D = ' 13' + ' 1' + ' 13', E =('13'+'1'+'13') * 1' WHERE s_no = ' 1' *; *
ELSE UPDATE SET DAILY.test_p = ('13' + 3), B = '1 ', '13' + '1' = C, D = ' 13' + ' 1' + ' 13', E =('13'+'1'+'13') * 1' WHERE s_no = ' 1' *; *END IF; END;
Concerning
John
http://obiee101.blogspot.com/ -
Print SQL with SQL output statements
I am a student in learning SQL for Oracle 10 g.
Our missions are typically a set of problems that have an SQL statement as the solution.
We pass in the SQL statement and SQL output generated by the statement.
I use SQL Developer to create my scripts, print my files, etc. Very convenient.
I want to be able to do is to somehow combine the two impressions that I always generate.
So I would like to have a report which has my SQL statement (Select * From Customers ;) and)
the output of SQL that has generated this statement.
Anyway is to do it with SQL Developer? Or maybe in another tool?
Thanks for any help!Just this question before your scripts:
set echo on
Have fun
K. -
PL/SQL package, output XML
Hello
I'm working on the Pl/sql package to generate the output in xml format using tags XML, but the output is the break with the following error when data have special characters as '& '.
Error:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Fix the error and then click the Refresh button, or try again later.
Whitespace is not allowed at this location. Error processing resource
I use the <? XML version = "1.0" encoding = "ISO-8859-1? > and even tried "UTF - 8' at the beginning of my xml." Anyone can guide me please how I can handle this.
Thank you!Can you guide me on how I can use CDATA for this specific tag.
XYZ & Co. Inc. SQL> set scan off SQL> select xmlelement("CUST_NAME", 'XYZ & Co. Inc') from dual; XMLELEMENT("CUST_NAME",'XYZ&CO --------------------------------------------------------------------------------
XYZ & Co. Inc SQL> select xmlelement("CUST_NAME", xmlcdata('XYZ & Co. Inc')) from dual; XMLELEMENT("CUST_NAME",XMLCDAT ---------------------------------------------------------------------------------First method automatically escapes the characters not valid and replaces them with their corresponding entity reference
-Second method encapsulates the data in a CDATA section so that there is no need to escapeYou can build the entire XML document with these functions, that's exactly what they did:
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb13gen.htm#g1047191
-
Generate output XML for a PL/SQL stored procedure concurrent program (EBS).
Hello
I trying to generate XML output for a simultaneous PL/SQL program and then use it as a model for BEEP.
Program PL/SQL for a report consist of sliders/queries and other calculations of output data.
Program (report) made up of topics, couple of col. values of one or more tables DB and rest of the columns are values read from DB colonel and calculated. The length of the neck extends up to 280 characters.
All out - put is shown using fnd_file.put_line (fnd_file.ouput,...);
before first fnd_file statement, included the following stmt.
fnd_file.put_line (fnd_file.output,' <? xml version = "1.0" encoding = "UTF - 8"? > ');
Using demand conc., notice ouptut poster error...
The XML page cannot be displayed
Invalid at the top level of the document. Error during processing of the resources ' http://ohcol0ws023.amp-ohio.org:8004/OA_CGI/FNDWRR.exe...
<? XML version = "1.0" encoding = "UTF-8"? >
I tried to add tags in the rest of the fnd_file.put_line stmts. as
fnd_file.put_line (fnd_file.output, '< Heading1 >' |) 'Report name ' | (/ head2 > '); etc.
View output shows the same error message.
PL. advise how go further or tell me the link, if it's already been answered earlier.
Thank you
PrakCopy the file from $APPLCSF / $APPLOUT to your customer and try to open it. Find out what's wrong with the code XML, for example, you may need to top level element:
Write to me if you can't get by - see my profile.
Kind regards
Gareth -
SQL output varies depending on the value with or without single quotes
Hello
My version of the database is the database Oracle 11 g Enterprise Edition Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production.
(1) when I use the query select * from hr.employee where id > = '82210' I get the below of lines
13205 selected lines.
2.) when I use the query select * from hr.employee where id > = 82210 I get the below of lines
11871 selected lines.
The ID table in hr.employee is ID NOT NULL VARCHAR2 (80).
I don't have much knowledge in SQL so please can someone explain why this difference in output?
Kind regards
007
Look at the example
create the table test16
(
Identification number,
SAL varchar2 (10),
name varchar2 (20)
);
insert into test16 values (1, "2005", "ABC");
insert into test16 values (2, '2045', 'ABC');
insert into test16 values (3, '2065', 'ABC');
insert into test16 values (4, '2075', 'ABC');
insert into test16 values (5, '1705', 'ABC');
insert into test16 values (6, '1805', 'ABC');
insert into test16 values (7, '1920', 'ABC');
insert into test16 values (8, '2010', 'ABC');
insert into test16 values (9, '0999', 'ABC');
insert into test16 values (10, '0789', 'ABC');
insert into test16 values (11, '510', 'ABC');
insert into test16 values (12, '455', 'ABC');
commit;
Select * from test16 where sal > = 200;
All 12 rows selected because there is an implicit conversion from column sal in numbers
Select * from test16 where sal > = "200";
Only 7 rows selected but waited 12
2005
2045
2065
2075
2010
510
455
Only the sal of lines that begin with a 2 character or more, those who are selected.
Another 1805,1920 sal... .are not selected
Note: Don't store the numbers in a column varchar2.
-
Global temporary table in PL/SQL with XML
Hello
I have the impression that it is something strange or maybe I'm missing something basic.
Step 1: Create a global Temp table that should not be specific transaction.
create a global temporary table Temp01
(
NUMBER OF TICKET_ID
, Varchar2 (10) of the REGION
NUMBER OF THE YEAR
, CO_ID VARCHAR2 (10)
) ON COMMIT DELETE ROWS.
Step 2:
My XML that goes as a parameter to a new function.
< TICKET >
< TICKET_ID > 38498051 < / TICKET_ID >
the USA < REGION > < / REGION >
< YEAR > 2014 < / YEAR >
XYZ123 < CO_ID > < / CO_ID >
< / TICKET >
Step 3: Create a Stand Alone function:
-drop function aagarwal.wr_creation;
create or replace FUNCTION XML_FUNC
(
ret_msg out varchar2,.
p_xmlval IN varchar2
)
RETURN varchar2
is
l_xmlval varchar2 (4000): = p_xmlval;
V_CO_ID VARCHAR2 (10);
V_CODE VARCHAR2 (10);
BEGIN
BEGIN
INSERT INTO Temp01
(
TICKET_ID,
REGION,
BLEACHED,
CO_ID
)
SELECT
EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET/TICKET_ID ') ID,.
EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET/REGION") REGION.
EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET per YEAR"),.
EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET/CO_ID ') CO_ID
FROM DUAL;
ret_msg: = 'SUCCESS';
-SELECT CO_ID IN V_CO_ID of aagarwal. TEMP_STAGE_WR;
-return ret_msg;
EXCEPTION
WHILE OTHERS THEN
ret_msg: = sqlerrm;
Return ret_msg;
END;
BEGIN
SELECT CO_ID INTO V_CO_ID FROM Temp01;
/ * MERGE IN the site is
With the HELP of aagarwal. TEMP01 T
WE (T.co_id = se.code AND se.type_nm = ' TYPE' and se.src_nm = T.region)
WHEN NOT MATCHED THEN
INSERT (ID, SRCNM, CODE, TYPENM)
VALUES (SHARED_SEQ. NEXTVAL, T.region, T.co_id, 'TYPE');
-commit; */
return ret_msg | "ACE" | v_co_id;
END;
END;
/
Fact - created function.
NOTE: MERGE statement is blocked and if the function was created in sweetness.
Step 4: Call the function
declare
l_out varchar2 (50);
l_outr varchar2 (50);
p_xml XMLTYPE.
Start
l_outr: = XML_FUNC (l_out, ' < TICKET >)
< TICKET_ID > 38498051 < / TICKET_ID >
the USA < REGION > < / REGION >
< YEAR > 2014 < / YEAR >
XYZ123 < CO_ID > < / CO_ID >
(< / TICKET > ');
dbms_output.put_line (l_outr);
end;
/
Step 5: Check the value being inserted into the temporary Table:
Select * from temp01;So far so good.
THE PROBLEM:
Now I want to tweek the XML_FUNC function above by uncommenting MERGE statement, which brings me to an error that is not differentiable:
I.e. PL/SQL: ORA-00942: table or view does not exist in line on MERGE pointing to Temp01 statement.
NOTE: I tested this Merge statement explicitly (as long as the execution of Stand Alone and also by calling via anonymous block PLSQL) and its absolutely perfect work. And SITE table exist.
PS: I would be grateful, if there is a better way to write this code? I'm not a regular PLSQL developer and so badly can write the code of practice.
Kind regards
AAG.
Using 11.2.0.3:
Owner of all these three objects is DBA.
Are you sure?
After the release of:
Select object_name, object_type
of object
where object_name in ('TEMP01', 'SITE', 'XML_FUNC');
You must grant the explicit right to select on the table for the owner of the function if the owners are different.
This works as expected for me (user DEV has all 3 items):
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
Logged in as dev
SQL >
SQL > create a global temporary table Temp01)
NUMBER OF TICKET_ID 2
3, Varchar2 (10) of the REGION
4, NUMBER OF THE YEAR
5, CO_ID VARCHAR2 (10)
6)
7. ON COMMIT DELETE ROWS.
Table created
SQL >
SQL > create table site)
Identification number 2
3, srcnm varchar2 (10)
4, code varchar2 (10)
5, typenm varchar2 (10)
6 );
Table created
SQL > create the sequence shared_seq;
Order of creation
SQL >
SQL >
SQL > create or replace FUNCTION XML_FUNC)
2 p_xmlval IN varchar2
3)
4 RETURN varchar2
5 is
6 l_xmlval xmltype: = xmltype (p_xmlval);
7. START
8
9 INSERT INTO Temp01
(10)
TICKET_ID 11,
REGION 12,
13 YEARS,
CO_ID 14
15)
16. SELECT ID EXTRACTVALUE(l_xmlval, '/TICKET/TICKET_ID'),
17 EXTRACTVALUE(l_xmlval, '/TICKET/REGION') REGION,
18 EXTRACTVALUE (l_xmlval, ' / TICKET per YEAR ') YEAR.
19 EXTRACTVALUE(l_xmlval, '/TICKET/CO_ID') CO_ID
20 FROM DUAL;
21
22. MERGE IN site
23. WITH THE HELP OF TEMP01 T
(24)
25 T.co_id = se.code
26 AND se.typenm = 'TYPE '.
27 and se.srcnm = T.region
28)
29 WHEN NOT MATCHED THEN
30 INSERT (ID, SRCNM, CODE, TYPENM)
31 VALUES (SHARED_SEQ. NEXTVAL, T.region, T.co_id, 'TYPE');
32
33 return "SUCCESS";
34
35 END;
36.
Feature created
SQL >
SQL >
SQL > set serveroutput on
SQL >
SQL >
SQL > declare
2
3 l_outr varchar2 (50);
4
5. start
6
7 l_outr: = XML_FUNC (')
');8
38498051 9
USA 10
2014 11
XYZ123 12
13
14 dbms_output.put_line (l_outr);
15
16 end;
17.
SUCCESS
PL/SQL procedure successfully completed
SQL > select * from site;
ID CODE TYPENM SRCNM
---------- ---------- ---------- ----------
TYPE 1 USA XYZ123
-
Hello
In our cloned instance of R12, the output of an XML report fails to print in pdf format,
It gives the result in XML.
I see error in the internal Manager log below
[09/06/13 20:48:47] [UNEXPECTED] [2684937:RT13570773] java.io.FileNotFoundException: / sd01/inst/apps/SD01_
ausperora17/appltmp/xdoW6CEwPQktR060913_0848470510
I checked the profile directory Temp XML option, it is set to the correct value.
Do I have to pay any other xml partner profile values?
Thank you
Please see
XML editor reports fail with java.io.FileNotFoundException on Temp Directory after cloning [1189764.1 ID]
XML editor reports fail with java.io.FileNotFoundException on multinode Clone [1351284.1 ID]
AppsMasti
Sharing is caring
-
Backup SQL + output to a text file
I have to use SQL + on one of my databases. No way around it. So I'll write my queries, execute them, check the output, tweak them and run again if necessary. So I could start with
Once I know that it's working properly, I wrap it in a procedure so I can get the data in a text file:SELECT ename, job FROM emp;
Then I import into Excel as data delimited on the pipe.SET TRIM ON SET PAGESIZE 2000 SET SERVEROUTPUT ON SIZE unlimited EXEC DBMS_OUTPUT.ENABLE(null) -- SPOOL c:\mySQL\out.txt -- BEGIN -- DECLARE -- CURSOR c_cur IS -- SELECT ename, job FROM emp; -- BEGIN -- DBMS_OUTPUT.PUT_LINE( 'NAME|JOB|' ); FOR r_cur IN c_cur LOOP DBMS_OUTPUT.PUT_LINE( r_cur.ename||'|'|| r_cur.job ); END LOOP; END; END; /
works fine until I have decide that I really need a column more. So I made changes on the SQL code, and two more changes in the part of the output (one for the title and one for the LOOP)
I was wondering if someone had written a cool procedure I could run across ALL SQL, and he would automatically know my names to column write the titles and then to loop through data automatically.
I'm not tied to the use of the exact procedure I described above. The key is, I'm looking for a general procedure that I can run any script through, and it will load the output for me, without further changes.Hello
Why do you not consider creation and HTML file which can be read easily with Excel.
that is to say:
SET SERVEROUTPUT ON SIZE UNLIMITED SET LIN 500 SET DEFINE OFF SET UNDERLINE OFF SET TAB OFF SET FEEDBACK OFF SET VERIFY OFF SET TERMOUT OFF SET PAGES 9999 SET MARKUP HTML ON TABLE "cellspacing=0 border=1" ENTMAP OFF spool myexcel.xls /* Replace the query below as you like */ SELECT * FROM EMP; spool off EXIT
The format is HTML, but once you load in Excel, you can easily save the format you like.
Kind regards.
Al
Maybe you are looking for
-
Password Bank found that Firefox has been uninstalled from this computer
I get this message and let me know what it means. "Password Bank found that Firefox has been uninstalled from this computer. Please confirm following elevation request to remove orphan password Bank support.
-
HP-Envy 100 D410a just shows (INITIALIZE) is on the screen!
HP-Envy 100 D410a was printing then stopped. When I turned it back on, just shows the printer (INITIALIZE) is on the screen! It was after I left the power for hours. Can't do anything to the screen. My firmware Version is: SLM1CN1039FR
-
Slideshow of invisible controls
When I start a slide show, the controls are invisible, and I can't seem to understand how to make them reappear. I can move on where they should be and clicking works, but I need to keep trying until I find the place for moving forward and backward j
-
similar tohttp://docs.Oracle.com/CD/E21764_01/doc.1111/e14309/soa_api.htm#OMDEV2855If 'oimURL' is an https URL, I care about the keystore, import certificates, etc.?If so, how do I?Is it possible to simply ignore the certificates? (for development pu
-
Clause of parallel in a table.
Hi allI have the table following (oracle 11 g 2), and I can't get rid of my parallel (PARALLEL 8) option. I run the following command: ALTER TABLE RR_XXX NOPARALLEL; but the parallel option does not disappear.Can someone tell me what I'm missing?Than