Sitemap

Amicuk Programming Answers

Constraint on XML

-0001-11-30   Views:14

Advertisement

I have a table which has a bunch of columns and one of which is XML type. I have .xsd for the XML which I plan to insert in that XML data type. How do I write a trigger on the table to make sure that the XML follows my schemaHi, This can be done usin

I have a table which has a bunch of columns and one of which
is XML type. I have .xsd for the XML which I plan to insert in that XML data type. How do I write a trigger on the table to make sure that the XML follows my schema

The replay answer
Advertisement
Hi,
This can be done using Oracle XML DB feature.
There is no need to write a trigger for this. All you need to do is: create the XMLTYPE column based on a registered schema. i.e first register the schema and then create the table with an XMLTYPE column based on this registered schema.
With this, Oracle XML DB feature will automatically check and validate if the input xml document is valid. You could also check on the XMLIsValid() SQL operator and isSchemaValidated() function.
Please look into the Oracle9i XDB documentation chapter 5, for details and sample code on this.
Registering Your XML Schema Before Using Oracle XML DB
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb05obj.htm#1032574
Creating XMLType Tables and Columns Based on XML Schema:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb05obj.htm#1036021
Later, for Validating XMLType look into the following:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb07tra.htm#1025228
Hope that helps.
Savitha.

Go to See the other 4 answers

Identity Constraint in XML Schema

Category:DefaultRelease time:2015-10-11Views:130

Hi, I am trying to validate an xml so that the value of one tag<ns0:transid> should be unique. The XML is given below: <?xml version="1.0" encoding="UTF-8"?> <ns0:transactions  xmlns:xsi='http://www.w3.org/2001/XMLSchema[More]

Indices and constraints on XML Tables/Columns (with Schema)

Category:DefaultRelease time:2015-10-11Views:130

Hi, I've read a lot of documents by know, but the more I read the more I got confused. So I hope you can help me. Frist my Oracle Server Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit I've manages to create a table with a[More]

Using ID constraints in XML Schema

Category:DefaultRelease time:2015-10-11Views:130

I've been testing out a schema containing a number of key/keyref constraints for validation with the DOM parser and I've been having problems. Specifically, when I've used predicates as in: blocklist/block[1], blocklist/block[position()=1] or blockli[More]

Constraint on XML

Category:DefaultRelease time:-0001-11-30Views:130

I have a table which has a bunch of columns and one of which is XML type. I have .xsd for the XML which I plan to insert in that XML data type. How do I write a trigger on the table to make sure that the XML follows my schemaHi, This can be done usin[More]

Loading Oracle Schema into XML Schema format

Category:DefaultRelease time:-0001-11-30Views:130

Hello, I'd like to load the Oracle schema information (tables/views, columns, and constraints) into XML Schema format, then read in the XML Schema information to instantiate objects which will be used to build adhoc/dynamic queries. I have the dynami[More]

Xpath and oracle business rules

Category:DefaultRelease time:-0001-11-30Views:130

Hi; are there any examples that demonstrate using XPath in a rule? Any comments on whether oracle business rules might be a valid choice for an application that needs to enforce a set of, and varying, constraints on an incoming XML document. Thanks f[More]

Please ,Please somebody help me.

Category:DefaultRelease time:-0001-11-30Views:130

Hi we are in the process of setting up a RAC. 2 solaris machines, we are using a netfiler for the nfs share acroos the 2 nodes. We are getting 2 errors installing Oracle Clusterware: Error 1) After you have entered the private, public and vip address[More]

Add a unique constraint on binary XML table

Category:DefaultRelease time:2015-10-11Views:130

How add a unique constraint of "brevet" field? The following INSERT failed SQL Error: ORA-19025: EXTRACTVALUE renvoie la valeur d'un seul noeud 19025. 00000 - "EXTRACTVALUE returns value of only one node" If the ALTER is made after the[More]

Using security-constraint in web.xml; not recognizing url-pattern tag

Category:DefaultRelease time:2015-10-11Views:130

I am creating a very simple jsp application within JDeveloper 10.1.3.1. I have 2 jsp files...a readData.jsp and a maintainData.jsp. I would like to deploy this application to Oracle Application Server 10.1.2.2. I would like to use Oracle Internet Dir[More]

Creating XML Schema from tables With Constraints

Category:DefaultRelease time:2015-10-11Views:130

Greetings, I'd have an interesting question. I finally am getting familiar with the various kinds of xml solutions provided by the oracle database, but hey here I have another interesting question I can't seem to get into life. I'm currently generati[More]

Web.xml and security constraints

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have several web services deployed. I only want to protect one of these web services. If I use "/services/*" in <security-constraint> of my web.xml file, all my deployed web services are protected. If I use "/services/aaaWebServ[More]

Hot
Hi guys, I just imported every photo I've ever taken into LR (21,000+ images, took about 4 days!). I had previously imported them into an Aperture trial, but Aperture was stupidly, impossibly slow, so now I imported them into LR. When I view them bot [More]
hi which packages must i install in order to be able to read /u01/app/oracle/product/11.2.0/db_1/dbs/initsmsdev.ora and how to create initsmsdev.ora as am also having problem startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initsmsdev.ora' LRM- [More]
firefox does not process paypaly continue_shopping links correctly. When you are at the paypal 'View Cart' and click on the continue shopping link it should take you back to the page you came from (this works in IE and Chrome) instead you end up on a [More]
We are trying to add NetworkInfo support to our iOS app to display a warning if the user is on mobile instead of WiFi. I've tried adding the Adobe NetworkInfo Native Extension (from the "binary" zip at http://www.adobe.com/devnet/air/native-exte [More]
I have created simple text editor as applet (by JTextPane). I have a trouble with the clipboard. The clipboard works correctly inside the applet, but I'm not able to paste text from outside text editors (e.g. notepad). But I found out that clipboard [More]
i need my esn for an insurance claim and can't find it    Sounds like someone has a new phone! Exciting. We do not offer the option to check the status of an ESN online, but we can confirm it's ability to be activated via Customer Service. Please fol [More]
Macbook Pro will not complete the start up....am left with a grey screen showing the apple logo and a bar that shows only a third of the start up process as being completed.Try: Mac OS X: Gray screen appears during startup BTW, this is the Mac Pro de [More]
IBM Thinkpad Laptop A31. I have been getting vertical blue pinstripe lines on my screen and when I try to install windows the screen is covered with rows of, what looks like, fat exclamation points. The installation instructions appear but are not in [More]
I upload a lot of my images to facebook when I'm done.  I've never had an issue before but recently I've been working a lot with reds and the images look horribly pixelated when uploaded.  I shoot in sRGB RAW on a 7d, edit in 16bit and export an sRGB [More]
Hi All, I am populating rows in a table by calling BAPI. I set the selection property to 1..n for the context model node in view and custom controller. I set the selectionmode property to multi for the table. I have a "Select All" button in my v [More]