XML and Oracle 9.0.1.0.0
how active function XML(XMLElement,..) in [
Oracle9i Enterprise Edition Release 9.0.1.0.0 -]
thanks.
Alex,
does a
select xmlelement("SQLX", 'Hello ,World!') from dual; work?
SQL> select xmlelement("SQLX", 'Hello World!') from dual;
XMLELEMENT("SQLX",'HELLOWORLD!')
<SQLX>Hello World!</SQLX>
It works for me in 9.2
SQL> select xmlelement("orderid", order_num) from orders;
XMLELEMENT("ORDERID",ORDER_NUM)
<orderid>1</orderid>
<orderid>2</orderid>
<orderid>3</orderid>
<orderid>1</orderid>
<orderid>2</orderid>
<orderid>3</orderid>
6 rows selected.
SQL>
Similar Messages
-
Just trying to clarify some issues as I try and learn about XML, and specifically how it integrates into the DB.
1 - Is there a way with Oracle tools for me to get an XSD of an existing 9i relational schema? We are not currently using the XML DB, but our middleware developers would like to have an up to date XSD to use for their internal mapping.
2 - Is there any way that I can keep that XSD up-to-date automatically, so I get a new one whenever the schema gets updated?
3 - If I wanted to investigate storing XML docs within the DB in native XML format, I need to have an XML DB, correct? Is this DB construct maintained seperatelly from my "normal" relational schema? or are they kept in sync by Oracle?
I know these may all be real basic questions, but as I said, I'm new to XML and Oracle. I am reading as much as I can, but there are a lot of docs out there.
Thanks,
MikeHi
1. On my opinion such a tool doesn't exists. Some parts can be implemented elsewhere, but not as described by you... e.g. with XSU if you specify the parameter "withschema" the XSD of the executed statement is generated. Another example is to use DBMS_METADATA to dump the data dictionary in XML (but not XSD, of course you could write your own XSLT to do this transformation...).
2. -
3. If you use XSD-based tables the XSD and the relational model are stored separately in the data dictionary. Therefore if you change the XSD you have to drop/create the XSD-based table... no schema evolution yet.
Chris -
Hi Wizards
I'm in an endeavour to do the following things -
1.Generate XML output from Oracle 8i Lite database
2.Modify the XML and update the database taking the modified XML.
My java platform is JDK 1.2. I've used the XML SQL Utility for Java, and in doing so i've been successful with the 1st step. I've used the Oracle 8.1.6SDK JDBC Driver which is compatible with JDK 2.The code fragment is like the following -
import java.io.*;
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
public class orasql1
public static void main(String args[]) throws SQLException
Connection conn = null;
String tabName = "emp";
try {
Class.forName("oracle.lite.poljdbc.POLJDBCDriver");
conn = DriverManager.getConnection("jdbc:Polite:POlite", "SYSTEM", "manager");
catch (Exception e) {
System.out.println("Oracle Connection error\t:");
System.out.println(e);
System.exit(0);
OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from " + tabName);
qry.setRowsetTag("SCHEMADOC_1");
qry.setRowTag("EMPLOYEE");
qry.setStyleSheet("emp.xsl");
String xmlString = qry.getXMLString(true);
conn.close();
try {
File output = new File("emp.xml");
FileWriter xmlFile = new FileWriter(output);
xmlFile.write(xmlString,0,xmlString.length());
xmlFile.close();
catch (Exception e) {
System.out.println("Output file error\t:");
System.out.println(e);
System.exit(0);
I am putting some sample code for step 2 in the following section -
import oracle.xml.sql.dml.*;
import java.sql.*;
import oracle.jdbc.driver.*;
import oracle.jdbc.*;
import java.net.*;
public class orasql2
public static void main(String args[]) throws SQLException
Connection conn = null;
String tabName = "emp";
String fileName = "emp.xml";
try {
Class.forName("oracle.lite.poljdbc.POLJDBCDriver");
conn = DriverManager.getConnection("jdbc:Polite:POlite", "SYSTEM", "manager");
catch (Exception e) {
System.out.println("An error has occurred.");
System.out.println("Please check your CLASSPATH variable..");
System.out.println(e);
System.exit(0);
OracleXMLSave save = new OracleXMLSave(conn, tabName);
URL url = save.createURL(fileName);
save.setRowTag("SCHEMADOC_1");
int rowCount = save.insertXML(url);
System.out.println("Successfully inserted "+rowCount+" rows into "+tabName);
conn.close();
Compiling the above code is fine, no errors! But while running the application I get the error -
Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: java.lang.Class
CastException: oracle.lite.poljdbc.OracleStatement
at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:345)
at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:248)
at orasql2.main(orasql2.java:27)
My question is whether this thing can be done at all using Oracle 8i Lite? If so then how?
Waiting for ur advices.
Biplab
(An Indian, but at present in Houston, Texas)It looks like be a classpath issue. Would you check with the class name.
-
Xml and oracle 8i (geom)
I try to excute the program called SampleSDOtoXML; wich exist in sdoapi_samples.zip and ;this program has for role to generate XML file from geom in oracle spatial 8i (sdo_geometry),and i include the directory for SampleSDOtoXML.class in my JAVA Classpath ,the compilation is good ,however, in execution it didnt generate any file but it give me this message:
Exception in thread "main" java.lang.NoClassDefFoundError: SampleSDOtoXML (wrong
name: sample/SampleSDOtoXML)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:242)
at java.net.URLClassLoader.access$1(URLClassLoader.java:210)
at java.net.URLClassLoader$1.run(URLClassLoader.java:191)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:185)
at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:279)
at java.lang.ClassLoader.loadClass(ClassLoader.java:249)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:308)
please, if you have any solutions dont hesitate.
thanks.It looks like be a classpath issue. Would you check with the class name.
-
Hi Oracle XML Team,
I really need to understand clearly about how 8i supports XML.
Please help to answer the following questions quickly.
1) Using the available components such as XML SQL utilities, XML
Class gen, Parser and the Servlet. Can I use all this to develop
an application to retrieve, store and query XML doc in 8i (do I
need any components such as intermedia)?
2) The licensing scheme for all the above 4 four components
stated that it is not for commercial use? But what if I need to
deploy my application soon ? Is there a separate licensing
scheme for deployment?
3) I am using 8i standard edition now, if I would to use
iFS/intermedia....do I need to get the Enterprise Edition?
Please help me. Thank you very much
Sam
nulli think you want something along the lines of :
stageFade_mc.swapDepths(theMovieOnTopAtTheMoment);
Note that only dynamically created movies have depths. So if
either of the movieclips in question are just sitting in your
timeline you cant swap their depths.
In that case you either need to duplicateMovieClip() or just
set things _visible property where apropriate.
good luck
jon -
XML and oracle 7.3.X Urgent
Dear Sir/Madam
Is there any product/package available to load XML files into database tables when running on a 7.3.X database in a client/server environment?
Thanks a lotI need to do the work on a UNIX box (if I am not mistaken, ODBC/JDBC would not work there). Ideas?
Thanks,
ah -
My name is robert and I am a PhD student at UCLA. I am a novice in using XML and Oracle. I would like to know what utilities and/or drivers I need to go from ascii to xml to oracle.
I am using Oracle 8, Windows 2000 and Ie5. Any suggestions would be greatly appreciated.
Thanks,
RobertMay I know what delimiters are you using? Seems like payload is not UTF-8 encoded and hence SOA is not able to understand the character. Make sure that payload is UTF-8 encoded.
Regards,
Anuj -
How to extract data from xml and insert into Oracle table
Hi,
I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
I need to extract the values of these columns and insert into the table
<Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
<Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>Re: Insert from XML to relational table
http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta= -
Porting data from Oracle8i to XML and from XML to Oracle 10g
Hai
I have a client database (using oracle 8i) and a server database (oracle 10g).
Due to lack of leased line connectivity i want to port these offline data from 8i to 10g
using a modem(dial up connection).Is there is any way to port data from 8i to XML
and from XML to 10g.
thanks in advance
dejiesThanks Nicolas,
As per documentation, it seems to be difficult for export/import from Oracle8i to 10g. Is that any way to achieve this? I have to append the newly imported data with old or exisiting data into Oracle10g.
Regards
Nikhil -
Oracle equivalent of SQL Server's "FOR XML" and "OPENXML"
Hi
Can someone please tell what are the Oracle's equivalent of SQL Server's "FOR XML" and "OPENXML" features?Probably you can try General XML forum General XML
Gints Plivna
http://www.gplivna.eu -
I have parsed the following xml document with the oraxml batch
and with the sample '..\xdk\demo\java\parser\dom\DOMSample' and
observed a diffent behavior in Oracle9i:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Document xmlns:n1='urn:example:some-names'
xmlns:n2='urn:example:some-names'>
<BadAttrs_XML_1.0 att='1' att='2' />
<BadAttrs_Namespaces n1:att='1' n2:att='2' />
<OKAttrs_XML_1.0 att='1' n2:att='2' />
</Document>
----------------------------1.) oraxml
C:\oracle\ora9011\xdk\demo\java\parser\dom>oraxml -version
-warning Namespaces2.xml
Parser version: Oracle XDK Java 9.0.1.0.0 Production
The input XML file is parsed without errors using partial
validation mode
Oraxml does not recognize the two attributes with the same name
in element 'BadAttrs_XML_1.0' as an error.
2.) oracle.xml.parser.v2.DOMParser
C:\oracle\ora9011\xdk\demo\java\parser\dom>java DOMSample
Namespaces2.xml
file:Namespaces2.xml<Line 8, Column 38>: XML-0124: (Fata
l Error) An attribute cannot appear more than once in the same
start tag.
oracle.xml.parser.v2.XMLParseException: An attribute cannot
appear more than once in the same start tag.
I have modified the DomSample.java. The DomParser just checks for
well-formed documents and doesn't validate the document anymore.
(only a comment before
parser.setValidationMode(DOMParser.DTD_VALIDATION);)
My question is:
Is there really a difference between oracle.xml.parser.v2.oraxml
and oracle.xml.parser.v2.DOMParser or which parameters do I have
to use to get the same results?
With Oracle8i, both report an xml error!!
(Oracle9i, Win2000, JDK1.3)
Thanx in advance!
MarkusIt would appear that there is a difference when a loadjava is given a jar vs. the individual class files. When I load the jar, I get the previously described error, but when I load the individual class files (the same class files that the jar contains) the error goes away.
Why? -
How to set buildID.xml and custom.properties in SDK
Hello,
I just completed a new build deployment of SAP ME5.2, because after I deployed the new version, I don't think I have set a
correct version number.Can you someone give me a sample how to set the buildID.xml and custom.properties? I am a new on the SAP ME5.2
The Base version is ME_Base_5.2.5.16.5_netweaver-71_Update.zip and
MEClient_Base_5.2.5.16.5_netweaver-71_Update.zip. the HB customzation
version is ME_xxxxxx_2.0.0.0.x_netweaver-71.
Within the sap note 1484551, you mentioned we need change the
SDKInstallDir/build/buildID.xml file, here is the context of the file:
buildID.xml -
<?xml version="1.0" encoding="UTF-8"?>
<buildID xmlns:xs="http://www.w3.org/2001/XMLSchema">
<customer>XXXXXX</customer>
<revision>1.0.0.0</revision>
<build>1</build>
</buildID>
buildID.xml -
1. how can we change the revision and build?
There is another file BuildToolDir/build/script/custom.properties, here
is the file context:
custom.properties----
This file contains build properties used to configure the build
system.
The name of the software vendor implementing the customizations.
vendor.name=xxxxxxxxx
Vendor build identifier. This value is used to uniquely identify
customizations built by a particular vendor for a particular customer
and base
application version.
This is also used in path locations and in naming certain build
artifacts, like the custom EJB module and the utility classes archive.
vendor.id=xxxxxxxxx
The installation of the J2EE engine installed in the development
environment.
ex. C:/usr/sap/CE1\J00
j2ee.instance.dir=J2EEInstanceDir
The web context path used to access the main web application. This
is used by the build to set the
context-root value in application.xml after an update has been
imported.
web.context.path=
The web context path used to access the production XML interface web
application. This is used by the build to set the
context-root value in application.xml after an update has been
imported.
xml.context.path=
The web context path to access resources from the web extension
application, like images and work instruction HTML files.
web-ext.context.path=web-ext
The target database vendor. Valid values are 'oracle' or 'sqlserver'.db.vendor=ORACLE
The JDBC driver configured for the application server.
db.drivername=VMJDBC
JDBC connection propertes for the WIP (Work In Process) database.
This is the primary application database.
db.wip.driverclassname=
db.wip.driver.url=
db.wip.host=
db.wip.port=
db.wip.sid=
db.wip.user=
db.wip.password=
JDBC connection propertes for the ODS (Open Data Store) database.
This is the offline reporting and archiving database.
db.ods.driverclassname=
db.ods.driver.url=
db.ods.host=
db.ods.port=
db.ods.sid=
db.ods.user=
db.ods.password=
Flag indicating whether to add DPMO NC codes to NC idat files when a
new update is imported. This value is initially
set by the installer according the the user selection.
dpmo.nc.codes=
The default locale used by the production system. The default locale
is the locale used to display locale
specific text and messages when the requested locale is not
available. This property does not need to
be set if the default locale is english.
default.locale=en
Used when running the build from Eclipse to locate the java compiler
used by the WebLogic EJB compiler.
jdk.home=C:/Program Files/Java/jdk1.5.0_20
Compiler debug mode. If set to 'true', debug symbols will be
compiled into the byte code.
compile.debug=true
Keystore alias
security.alias=xxxxx
Keystore password
security.storepass=ChangeIt
Key password
security.keypass=ChangeIt
Keystore type (jks=default,jceks,pkcs12)
security.storetype=jks
Optional source control build identifier that is to be displayed with
standard version information.
scs.build.ID=
Optional extended version information to be displayed with standard
version information.
ext.info=
custom.properties----
2. How can we change this here?
Regards,
Leon Lu
Edited by: Leon Lu on Aug 4, 2011 11:14 AM
Edited by: Leon Lu on Aug 4, 2011 11:21 AMHi,
I created one request with logo in the header an page in the footer etc. and called StyleSheet. After you can import this formats by each request.
You can do this in compound layout.
Regards,
Stefan -
Reports Requirements using R12 and Oracle 10g Reports
Hi All,
Looking forward to some valuable inputs to propose a technical solution in R12 using 10g Reports Developer.
Requirements are :
1. Report output should be in Excel Format. ( Is this possible without XML Publisher using 10g Reports only )
2. Report Parameters to have multi selection criteria. ( Is this possible in 10g Reports and Oracle Apps, Report Manager responsibility ?)
Regards,
Anand>
1. Report output should be in Excel Format. ( Is this possible without XML Publisher using 10g Reports only )
>
Yes, Reports can create output in Excel - but XML Publisher offers better and easier options.
>
2. Report Parameters to have multi selection criteria. ...
>
Pl explain what you mean by multi selection criteria.
HTH
Srini -
How to store data from xml in oracle database
Hello All
Could anyone tell me ways of storing XML in Oracle and whats the best one in terms of performance issues.
any URL to this q/s would be great.
thanks
kedarBen,
The following link as some information regarding DOM API and XSQL.
http://asktom.oracle.com/pls/ask/f?p=4950:8:2923508047773696280::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:17309127931717
For XML DB, you may want to create an XMLSchema and build a table off the schema definition. Then use WEBDAV to load the xml into a folder (ie object table) Once the xml is in the database you could build a view for a relational look at the data.
Example from XMLDB Techical White Paper doc.
create or replace view PURCHASEORDER_MASTER_VIEW
(reference, requestor, userid, costcenter,...)
as select extractValue(Value(p),'/PurchaseOrder/Reference'),
extractValue(value(p),'/PurchaseOrder/Requestor'),
extractValue(value(p),'/PurchaseOrder/User'),
extractValue(value(p),'/PurchaseOrder/CostCenter'),...
from PURCHASEORDER p -
Import/insert data from XML into Oracle database tables?
Hi. (I am using JDeveloper 10.1.3.3.0 and Oracle 10g)
I have been able to export the data from one of my database tables by using a View Object and .writeXML.
Now, I want to take an xml file that is formatted in the same way as what is spit out by the writeXML and put that info in my database table. I followed online examples and have tried using .readXML like so:
Element element = XMLDoc.getDocumentElement();
vo.readXML(element, -1);
I know it is sort of working, because at first I got an error message that one of the required attributes was missing. So, I added that attribute to my xml file and ran my code. No errors. But, I checked my database, and the new records were not added.
Is there something I have done wrong? Or is there perhaps something I left out? I also noticed there were several versions of readXML like readFromXML. Which one should I use and how?
Thanks.KUBA, I changed my code to match your example:
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
File xmlFile = new File("C:/myfilehere.xml");
Document doc = db.parse(xmlFile);
Element element = doc.getDocumentElement();
vo.readXML(element, -1);
vo.getDBTransaction().commit();
I still get no errors, but my database table has no new records.
Any ideas why?
Thanks.
Maybe you are looking for
-
I am trying to connect an airport extreme to extend my wifi coverage and it doesn't work
I hope someone can help me. I have an Apple Airport extreme gen 5. I have a BT router/modem that I connect to my broadband and its signal is OK but not great. I have multiple apple devices, a windows PC, and a Panasonic smart TV. I also use Belkin
-
I would like to create a report that runs a different sql statement based on the parameters passed in. The column layout won't change but the group by sections will(I think I can handle that by suppressing field when parameter is null). For example,
-
Issue with the presence indicator in list/library web part.
When viewing a user field (Created By, Modified By or a custom People column) through the list web part (either through the default page /Forms/AllItems.aspx or a custom web part page using a list/library) the presence indicator always says presence
-
Apex 3.2 group select list
Hi, I just want share this if you are still in older version of Apex and you use jQuery. I did made "plugin" for grouped select list See sample here http://actionet.homelinux.net/htmldb/f?p=100:86 Plugin source ;(function(){ jQuery.fn.htmldbLovOptGrp
-
Apple TV 3- screen resolution 1080P
Hi Guys I was having a problem with the screen resolution at 1080P and have fixed this by using a new generation 1.3/1.4 HMDI Lead. Also if you run thought a reciever amp then make sure the HMDI Port will support the 1080P format It works fine now