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
we used to have our own list of favorites when using ie. How do we achieve this on firefox. I would also like to have my history separate from my wifes.Separate Windows User Logon Accounts will provide for data separation. Or you can use separate Fir [More]
How to create a public view for sharepoint list A and deploy this view to specific user personal view? Is that possible OOTB?Views cannot be exported or moved. Can you elaborate your requirement? --CheersRead other 3 answers [More]
Hi, I ran "yum update" on fedora core 5 and now sqlplus does not start anymore. I get this error: sqlplus: error while loading shared libraries: /opt/oracle/xe/app/oracle/product/10.2.0/server/bin/../lib/libnnz10.so: cannot restore segment prot [More]
Hi, I have brought a mac mini exactly 1 month back and while moving to a new office it was stolen. I have registered it, does anyone knows how i can trace the Mac mini. I have all the serial no and details for the Mac mini. Please, let me know. Thank [More]
My client wants to default VAT 4 % for 1 particular material group...It means if i create PO for that particular material belonging to that material group  it should fetch VAT  4 % default. How to map it?Hi, For the VAT condition type, maintain acces [More]
We have several PC Labs for our Students, and normally we have 2 printers per lab.  We would like to have half of the lab printing to one printer and the other half of the lab printing to the other printer.  I have been successful in deploying the co [More]
Hello LabVIEW gurus, I am just given a few software tools to add functionality and rewrite, each of which is a big spaghetti mess and each tool has 100+ vis all sphagetti, these tools control a very complex machine talking via seria, parallel, ethern [More]
Hi, We moved recently from Designer 6 to Designer 6i. When asked to generate the CG_REF_CODES table, Designer 6i created a table similar to the one we already had under Designer 6 except for column RV_TYPE which is missing. Does anybody know if this [More]
If I have multiple separate projects and now want to combine them, edits, titles and all into a larger project, is it possible? I expected that it might be possible to drag one project into another and place it intact onto the timeline for the new pr [More]
Hello, Could someone please guide on what could be the reason that spool printing takes a long time for just one user ? I've monitored all the spool processes through SM50, and I've found that a very long time elapses before the printing job appears [More]