SQL in XML out
hi folks
Any one know of any db package that takes sql and puts xml tags around it like the XMLELEMENT in 9i.
I am working on 8i db.
Cheers
Tappies
I presume from your answer that the only option i have is to hard code the xml in to the sql results.
Similar Messages
-
PL/SQL TABLE AS OUT ON PROCEDURE CALL AND JDBCTHIN(NEED HELP
How can I pass pl/sql record in and out
and pl/sql tables in out thru a pl/sql procedure using jdbc with
the zip file of 816classes12.zip...
I have tried everything I know...
I know the procedure is working, others are using it with in
Oracle...
I need to use the information it generates.
here is what I have so far...
try
Class.forName ("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
oracle.jdbc.driver.OracleConnection conn =
(oracle.jdbc.driver.OracleConnection)
DriverManager.getConnection ("jdbc:oracle:thin:@--","NA","NA");
// SQL92 SyntaxCallableStatement
oracle.jdbc.driver.OracleCallableStatement cstmt =
(oracle.jdbc.driver.OracleCallableStatement)conn.prepareCall
("{call cbmd_proposal_PKG.DefaultTerms (?,?,?,?)}" ) ;
cstmt.setString(1,"5118");
cstmt.setString(2,"3");
cstmt.registerOutParameter
(2,oracle.jdbc.driver.OracleTypes.NUMBER);
cstmt.registerOutParameter
(1,oracle.jdbc.driver.OracleTypes.ARRAY,"");
cstmt.execute();
catch(Exception e)
System.err.println(e.toString());
e.printStackTrace();
nullThe "X" in the second registerOutParameter is the type name which
you have created in oracle DB.
eg. if you have created a nested table
create Type integer_table is table of number(10);
then "X" = "INTEGER_TABLE" and it has to be in caps
and other thing to keep in mind is that it only works with nested
table or varray and not with pl/sql table.
Al Pivonka (guest) wrote:
: How can I pass pl/sql record in and out
: and pl/sql tables in out thru a pl/sql procedure using jdbc
with
: the zip file of 816classes12.zip...
: I have tried everything I know...
: I know the procedure is working, others are using it with in
: Oracle...
: I need to use the information it generates.
: here is what I have so far...
: try
: Class.forName ("oracle.jdbc.driver.OracleDriver");
: DriverManager.registerDriver (new
: oracle.jdbc.driver.OracleDriver());
: oracle.jdbc.driver.OracleConnection conn =
: (oracle.jdbc.driver.OracleConnection
: DriverManager.getConnection
("jdbc:oracle:thin:@--","NA","NA");
: // SQL92 SyntaxCallableStatement
: oracle.jdbc.driver.OracleCallableStatement cstmt =
: (oracle.jdbc.driver.OracleCallableStatement)conn.prepareCall
: ("{call cbmd_proposal_PKG.DefaultTerms (?,?,?,?)}" ) ;
: cstmt.setString(1,"5118");
: cstmt.setString(2,"3");
: cstmt.registerOutParameter
: (2,oracle.jdbc.driver.OracleTypes.NUMBER);
: cstmt.registerOutParameter
(1,oracle.jdbc.driver.OracleTypes.ARRAY,"X");
: cstmt.execute();
: catch(Exception e)
: System.err.println(e.toString());
: e.printStackTrace();
: The "X" in the second registerOutParameter is still unknown to
: me.
: The JavaDoc for the
OracleCallableStatement.registerOutParameter
: is not clear.
: Can any One help simplify this...
: Thanks
null -
Could we use embedded SQL for XML in .pc ?
Hi,
Can we use embedded SQL for XML in .pc ?
<1> assume we have run SQL statements in Oracle9i:
SQL>create table MY_XML_TABLE
(Key1 NUMBER,
Xml_Column SYS.XMLTYPE);
SQL>insert into MY_XML_TABLE(key1, Xml_Column) values
(1, SYS.XMLTYPE.CREATEXML
('<book>
<chapter num="1">
<text>This is the my text</text>
</chapter>
<book>')
<2> Could we directly translate it in .pc as usually:
<outlined, not exactly)
int emp_number = 1;
XML_Data emprec; /* ?????? */
EXEC SQL SELECT M.Xml_Column.GETCLOBVAL() as XML_Data
INTO :emprec INDICATOR :emprec_ind
FROM MY_XML_TABLE M
WHERE Key1 = :emp_number;
Thanks
MJreply by myself.
No problem!!
===============================
int emp_number = 1;
struct emprec{
char feature[1280]
EXEC SQL SELECT M.Xml_Column.GETCLOBVAL() as XML_Data
INTO :emprec INDICATOR :emprec_ind
FROM MY_XML_TABLE M
WHERE Key1 = :emp_number; -
I hope this is the right forum to post. I was wondering if there are any good tutorials or books on SQL to XML?
Basically I need to query accounts in the state of North Carolina that have recieved a certain document in the past day. That is a very easy task to do in SQL however the state of NC wants us to report our findings in a specific XML schema using nodes.
Luckily I have the schema which was given by the state of NC however not sure how to get my query to fit into the XML schema. Just wondering from a beginners perspective.
Sorry for the newbie questions.The [XML DB Forum|http://forums.oracle.com/forums/thread.jspa?threadID=410714&tstart=0] is a good place to start.
-
My coldfusion service crashes intermitantly and when I check
the application logs the error that I see for the time frame is the
one below. Does anyone know where I might begain to solve this?
Thanks!
Error Executing Database
Query.coldfusion.sql.DatabaseConnectionException: Timed out trying
to establish connection The specific sequence of files included or
processed is: E:\wwwroot\lifeworks\default.cfmI'm no expert, but thought I would try to be helpful.
I was getting this same error on a regular basis.
The short term fix was to restart the ODBC server service.
The long term fix was twofold:
1. I recreated the ODBC connection in ColdFusion
Administrator to use the system connection (I was using the SA and
PW for login).
2. I created a second user ODBC connection as well as the
system one under ODBC in Windows Server 2003.
I haven't had the problem since.
I also read a pretty good set of "stuff" to try from the help
area:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17277
Hope this helps. -
Import SQL Developer xml History files to a table
I'd like to import my SQL Developer xml history files into an Oracle table. What's the best way to do this?
I had some success in Pages 1, but I've only tried a couple of times so far in Pages 2 without success. The trick was to make sure the table is the exact number of columns wide. It's very "klunky" but I've ended up converting the tab-delimited text to a table in AppleWorks, saving the AppleWorks file with the table as a "floating" object (fixed objects don't translate) & opening the file in Pages. It's quicker & easier for most of what I do to just drag & drop in Pages.
Peggy -
Hi, Im very new to this and have a question: how do I transform sql to xml via xslt or jsp?
forexample:
DROP TABLE IF EXISTS bokbase;
CREATE TABLE bokbase (
bokID SMALLINT PRIMARY KEY AUTO_INCREMENT,
Regdato VARCHAR(15),
Writer VARCHAR(50),
Title VARCHAR(100),
Publisist VARCHAR(30),
place VARCHAR(30),
year VARCHAR(4),
Isbn VARCHAR(15),
about VARCHAR(20),
extra VARCHAR(255));
INSERT INTO bookbase VALUES ( 195,'1999.09.13','Gates,bill,'will it ever work?','microsoft','New York','1980','82-521-0989-6','something','');
thank you in advance.Try this SQL
select
xmlelement("BOKBASE",xmlelement("BOKID",bokID),xmlelement("REGDATO",regdato),xmlelement("WRITER",writer),
xmlelement("TITLE",title),xmlelement("PUBLISIST",publisist))
from bokbase -
SQl to find out the last business day of a given week
Can any one please let me know what will be the SQL to find out the last business day (monday-friday) of a week?
Edited by: 863997 on Oct 6, 2011 10:40 AMAssuming for "this week" that you want "last week Friday," then here is the SQL:
TIMESTAMPADD(SQL_TSI_DAY,-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFWEEK(CURRENT_DATE)*-1, CURRENT_DATE))
If you want the "nth" business day of the month, click on this link here:
Re: calculation of Business day in OBIEE -
Sql to find out combination of true and false
Hi all,
Could any one provide the sql to find out combination of true and false . For eg: if I have 3 elements a , b c i would like to get below o/p
a b c
t t t
t t f
t f f
f f f
t f t
f f t
your reply is greatly appreated - thank youDo you mean something like this (all permutations) ?
SQL> with t as (
2 select 't' bool from dual union all select 'f' from dual)
3 select a.bool a,b.bool b,c.bool c
4 from t a,t b,t c
5 /
A B C
t t t
t t f
t f t
t f f
f t t
f t f
f f t
f f fIf not, then you already got correct answers regarding boolean type in sql.
Best regards
Maxim -
The SQL has aged out of the cursor cache.
Hi,
on 10g R2, Ihave the following :
The SQL has aged out of the cursor cache.
Does-it mean that undo_retention is not enough big?
For the moment it is 10800, 3 hours.
Thanks.Hi,
The issue is that when in sql advisory I click on "Schedule SQL tunning advisor" it gives me "The SQL has aged out of the cursor cache".
If shared_pool is =0 , (automatic management) would it be usefull to define shared_pool_reserved_size value ?
In documentation it is said :
7.3.8.2 When SHARED_POOL_RESERVED_SIZE Is Too Small
The reserved pool is too small when the value for REQUEST_FAILURES is more than zero and increasing. To resolve this, increase the
value for the SHARED_POOL_RESERVED_SIZE and SHARED_POOL_SIZE accordingly. The settings you select for these parameters
depend on your system's SGA size constraints.
Increasing the value of SHARED_POOL_RESERVED_SIZE increases the amount of memory available on the reserved
list without having an effect on users who do not allocate memory from the reserved list.And actually I have REQUEST_FAILURES =15.
Thank you. -
Explain about sql server XML
All related topic about XML in sql server
Hmm
Do you expect someone to write an essay for you?
Why not do some google search?
A simple search on SQL Server XML brings you lots of articles including these
http://technet.microsoft.com/en-us/library/ms189887(v=sql.105).aspx
https://www.simple-talk.com/sql/database-administration/manipulating-xml-data-in-sql-server/
https://www.simple-talk.com/sql/learn-sql-server/the-xml-methods-in-sql-server/
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
XDK for PL/SQL and XML Parser for PL/SQL
Is there a difference between the terms:
XDK for PL/SQL
and
XML Parser for PL/SQL V2
or are they the same thing...?
cheers,XDK stands for XML Developer's Kit. There are Oracle XDKs for Java, C, C++, and PL/SQL. These development kits contain building blocks for reading, manipulating, transforming, and viewing XML documents.
XML Parser is one component of XDK. Other components of XDK are
XSLT Processor, XSU, XSQL Servlet, XML Class Generator, etc.
For more information on XDK and its components please refer to:
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx01bas.htm#1656
Regards,
Anupama
http://otn.oracle.com/sample_code/content.html -
Hey everyone quick question that I hope someone can help me
out with. We are currently in the process of making a switch from
our old CMS to websphere and we have a few thousand PDF documents
that have hard coded links in them.
Anyhow I was thinking I might be able to use DDX with CF8 to
extract the doc info in XML then use CFDocument to recompile them
back again but change the links to be a different URL.
I have been able to get the XML out with DDX but its not
retaing the formatting in the xml or the link information.
So I guess my question is, is this possible with DDX?
I also some some people talking about a open source solution
called PDFBox, but its all java and I'm not a java expert, but if
anyone knows of some tutorials or examples of using this with CF
that would be awesome.
Thanks for any help
Mike.Yes, but the way you do this will depend on the tool you use. For instance when using Axis refer to:
http://wiki.apache.org/ws/FrontPage/Axis/AxisClientConfiguration/ViewSOAPMessages -
Which way to go with PL/SQL and XML
Hi fellows,
I have a general question to XML on Oracle.
I read already some parts of the three manuals coming with the online documentation of 9i
- XML developer kit XDK
- XML API - XDK and Oracle XML DB
- XML database developer guide Oracle XML DB.
Also I wrote already a PL/SQL package using DBMS_XMLGEN to generate XML data from relational Oracle tables.
Actually I like the simplicity how I can create XML data with this DBMS package but I still missing the features like using a DTD/XML Schema to generate XML data.
I still don't know what the best way would be to use these features of XML in Oracle.
Hopefully someone can give me some advise and possibly can point to some code samples so that I can see the proper use of the package.
How about DBMS_XMLQuery?
To use this package, would that be the better solution for my problem?
Any comment much appreciated.
Thanks
FredHi Fred,
Having written a fair amount of PL/SQL code to generate and process XML in the past years, I can give you my opinion on the matter. If you look at the PL/SQL API's Oracle has been written to handle XML, you will find two types/categories of API's: PL/SQL code based on wrapping java (i.e. DBMS_XMLQUERY) and PL/SQL code based on C (i.e. DBMS_XMLGEN). The first category is usually slower, so I tend to use these only if there are no other options. You can measure execution times by executing the same query using both DBMS_XMLGEN. vs. DBMS_XMLQUERY.
I usually tend to store xml into relational tables by extracting the xml document in PL/SQL using the functions XMLType data type offers (i.e. extract, existNode, getStringVal, etc) function rather than using DBMS_XMLSTORE for flexibility reason (more control over what's being stored).
Besides the PL/SQL API's there are some rather neat SQL functions to handle XML (i.e. XMLElement, XMLForest, XMLAgg, XMLAttribute, etc) I like to use to build XML documents that are to complex for DBMS_XMLGEN. But, on the downside, I think these functions might cost considerable amounts of CPU, because behind the scene a DOM-tree is build in the SGA/UGA(?), especially on large XML structures or high concurrency systems. I have not measured this yet, so I say might.
Further, what I think is lacking from the Oracle API's in general is handing of CDATA sections and the fact that some XML functions default generate "pretty-printing" XML, which can not be switched of as far as I know. In my opinion XML should never be "pretty printed", because XML basically is about data transportation, not about lay-out. CDATA sections are not handled, even worse "<![CDATA[ ]]>" is being escaped (to < and >) and not properly interpreted when processed back to text. -
XML out ... and in
For an automated data transfer I need to get a database (relational structure) to export to XML and to be able to import a similar structure sent by our partners.
I have been googling on this and there seems to be a massive number of options and tools available. That's great but it has got me rather confused.
At the moment, it looks like I will be converting from XML to CSV using XSLT/Saxon and then importing into Oracle. In the other direction (i.e. Oracle to XML) I am hoping to be able to use Oracle SQL and include the XML tagging at the time of generation.
However, none of this is really pretty and so I was wondering if anyone out there had any tips on how best to 'shunt' data to and from XML most comfortably.
Any tips or links would be gratefully received.
Regards,
Alan SearleFor handling XML data, Oracle provided XML DB. You simply store your XML directly into XMLTYPE datatype in Oracle and can process this XML data by using XML queries. For more information please refer XML DB.
XML DB
http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/transformxml/TransformXML.html
Maybe you are looking for
-
How to import a table in oracle
thanks!!
-
Can we read a file which is serialized in MFC using Java
I have a file in which Serialized data is stored using an MFC application (object of CArchive). 1. Is it possible to read this file using Java and to retrived the data. 2. Is yes, which all Java-classes will be needed to explored. Thanks -Vini
-
Post vendor Invoice without Purchase order.
Hi all good afternoon how can i post vendor Invoice without Purchase order. And any option Regards Manju
-
I have 4 menu list called the first Departure containing the ( countries ) when I select from this menu list, shows the names of cities on this Departure/mL in second menu list , and I have third menu list called Arrival containing the ( countries )
-
Hello, My apologies if there is another thread about this--I did search and was unable to turn up anything. I am trying to connect my Nomad IIc to my new Windows Vista machine--HP Pavilion laptop. Basically, I can't get the driver or MediaSource soft