How do I expose XMLType data in the repository

Assume the PO schema po.xsd
[oracle@chambers oracle]$ head po.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xdb="http://xmlns.oracle.com/xdb"
           version="1.0"
           xdb:storeVarrayAsTable="true">
  <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
  <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
    <xs:sequence>
      <xs:element name="Reference" type="ReferenceType" minOccurs="1" xdb:SQLName="REFERENCE"/>
      <xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
      <xs:element name="Reject" type="RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
...I have a document that conforms to the schema purchaseorder.xml
[oracle@chambers oracle]$ more purchaseorder.xml
<PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nubridges.com/jchambers/po">
  <Reference>SBELL-2002100912333601PDT</Reference>
  <Actions>
    <Action>
      <User>SVOLLMAN</User>
    </Action>
  </Actions>
  <Reject/>
  <Requestor>Sarah J. Bell</Requestor>
  <User>SBELL</User>
  <CostCenter>S30</CostCenter>
  <ShippingInstructions>
    <name>Sarah J. Bell</name>
    <address>400 Oracle Parkway
Redwood Shores
CA
94065
USA</address>
Step 1. Register the schema
  DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://www.nubridges.com/jchambers/po',
    SCHEMADOC => bfilename('ORACLE_USER_HOME', 'po.xsd'),
    CSID      => nls_charset_id('AL32UTF8'));
Step 2. Verify the registration
SQL> desc purchaseorder
Name                                      Null?    Type
TABLE of SYS.XMLTYPE(XMLSchema "http://www.nubridges.com/jchambers/po" Element "PurchaseOrder") STORAGE Object-relational TYPE "PURCHASEORDER_T"
Step 3. Insert a valid PO into the database
insert into purchaseorder values(XMLType(bfilename('ORACLE_USER_HOME', 'purchaseorder.xml'), nls_charset_id('AL32UTF8')));
Step 4. Verify PO insert ok
SQL> select * from purchaseorder
  2  ;
SYS_NC_ROWINFO$
<PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamesNow, I want to be able to expose the purchase order via HTTP/WebDav. In other words, I want to create a repository resource.
Step 5. Create a folder
DECLARE
  b BOOLEAN;
BEGIN
  b := DBMS_XDB.createFolder('/jchambers');
END;
Step 6. Create the resource.
How do I do this using DBMS_XDB.createResource?
I know I want to use one of these approaches, but how (I need some examples):
Creates a new resource with the given XMLType data as its contents:
DBMS_XDB.CREATERESOURCE(
   path    IN  VARCHAR2,
   data    IN  SYS.XMLTYPE)
RETURN BOOLEAN;Given a REF to an existing XMLType row, creates a resource whose contents point to that row. That row should not already exist inside another resource:
DBMS_XDB.CREATERESOURCE(
   path     IN  VARCHAR2,
   datarow  IN  REF SYS.XMLTYPE)
RETURN BOOLEAN;Please advise. Thanks

Step 6. Create the resource.
How do I do this using DBMS_XDB.createResource?
Creates a new resource with the given XMLType data as its contents:
In this case you do not need to insert the row into the table. When you create the resource XML DB will automatically store the contents of the resource in the table for you...
Eg
declare
  res boolean;
begin
  res :=  dbms_xdb.createResource('/jchambers/purchaseorder.xml',
                                         bfilename('ORACLE_USER_HOME', 'purchaseorder.xml'),  nls_charset_id('AL32UTF8'));
end;
/Given a REF to an existing XMLType row, creates a resource whose contents
point to that row. That row should not already exist inside another resource:
declare
  res boolean;
  xmlref ref xmltype;
begin
  select ref(x)
     into xmlref
     from PURCHASEORDER x
    where existsNode(object_value,'/Some/Xpath/That/Identifies/Exactly/One/Row') = 1;
  res :=  dbms_xdb.createResource('/jchambers/purchaseorder.xml',xmlref);
end;
/

Similar Messages

  • How can I save my data and the date,the time into the same file when I run this VI at different times?

    I use a translation stage for the experiment.For each user in the lab the stage position (to start an experiment) is different.I defined one end of the stage as zero. I want to save the position , date and time of the stage with respect to zero.I want all these in one file, nd everytime I run it it should save to the same file, like this:
    2/12/03 16:04 13567
    2/13/03 10:15 35678
    So I will track the position from day to day.If naybody helps, I appreciate it.Thanks.

    evolution wrote in message news:<[email protected]>...
    > How can I save my data and the date,the time into the same file when
    > I run this VI at different times?
    >
    > I use a translation stage for the experiment.For each user in the lab
    > the stage position (to start an experiment) is different.I defined one
    > end of the stage as zero. I want to save the position , date and time
    > of the stage with respect to zero.I want all these in one file, nd
    > everytime I run it it should save to the same file, like this:
    > 2/12/03 16:04 13567
    > 2/13/03 10:15 35678
    >
    > So I will track the position from day to day.If naybody helps, I
    > appreciate it.Thanks.
    Hi,
    I know the function "write to spreadsheet file.vi"
    can append the data
    to file. You can use the "concatenate strings" to display the date,
    time as well as data... Hope this help.
    Regards,
    celery

  • I unfortunately just got my IPhone 4s stolen.I thought I had the find my iPhone enabled but I didn't because I cannot locate the phone when I sign in ICloud.How can I erase all data on the phone so the thief can't access my personal information.

    I unfortunately just got my IPhone 4s stolen.I thought I had the find my iPhone enabled but I didn't because I cannot locate the phone when I sign in ICloud.I have a password on the phone but i'm not sure if I turned on the option where the phone resets if you incorrectly put the password more than ten time. I immediately called my phone company (Verizon) and reported the phone stolen.So I know whoever took the phone cannot place calls or use the phone. But can they still access my data on the phone if they manage to unlock the phone?  If so how can I erase all data on the phone so the thief can't access my personal information? is there any other way other than Find my IPhone to wipe off the data on the phone? I really don't want my personal information such as pictures, text messages, notes and social networks profile available to a stranger!!? Help please!!!

        Hello thewrongway,
    I'm sorry to hear about your phone!  I understand the need for an active device. You are able to activate an old device and process an insurance claim for your iPhone 4s within 60days from the incident date.  Keep in mind if the old phone is not a smartphone and you currently have unlimited data that feature will fall off.  If you have a tier data plan no changes will be made.  Please let me know if you have any additional questions.  Thank you.   
    TominqueBo
    VZW Support
    Follow us on Twitter at @VZWSupport

  • How do I get routing data from the Map App (powered by TomTom) so I can display the point-to-point annotations (turn-by-turn navigation) without leaving my own application.

    I have a tableView displaying a list of contacts from a Cloud Database.  After selecting a contact, I push to a programmatically created MKMapView.  Then I display the initial region (the view) that includes the users current location (starting point) and their selected destination (end point).
    Now I want to display annotations (as described in the Location Awareness Programming Guide) that displays polylines which will represent the turn-by-turn navigation IN MY OWN APPLICATION, and not in the Map App currently used in IOS6. 
    Due to licensing and its becoming depricated in IOS 6, I do not want to get routing data from the Google Maps API.  How do I get routing data from the IOS 6 Map App (powered by TomTom) so I can display the point-to-point annotations (turn-by-turn navigation) without leaving my own application?
    I checked out Stack Overflow and other forums which basically left me with the impression that this is not possible. I also checked out the TomTom iPhone Mobile SDK User Guide from the TomTom Developer Portal and am still confused.  It must be possible to retrieve routes, since the Map App can display turn-by-turn directions.  How can I retrieve turn-by-turn data that I may display as a route within my own application?

    Thanks Michael. Apologies for the slow reply I was away for a bit (holiday blitz at work and visiting family madness etc.etc.) back now, I set both options you requested to "never " and retried the CMS software with no change. 
    I do have progress of a sort though, as a test I took a separate test PC and put a clean install of Win7 on and loaded up the CMS software (it worked perfectly) and then took the version of ole32.dll off that machine and put it onto the computer I had built
    for her (using Linux) and...
    got a new error code. Darn I was so sure I had found a clever solution this time lol.
    Anyway now when the CMS fails it gives me a similar error but the offending module is "ntdll.dll" sooo... I tried taking the "working" version of ntdll.dll from the test box and moving it over (making sure to back up the existing ones
    first so I could put them back if needed) to her new PC and the PC would not boot. 
    It seems to want the original versions of a few Dynamic Link Libraries and if I could somehow give it those while not breaking Win7 it should theoretically work seeing as it no longer errors with ole32.dll. 
    ntdll.dll however seems necessary for Win7 to boot.
    So what I am wondering now is:
    Is there some way to have both versions of the DLL file in the system32 folder (bypassing the "cannot have two files with the exact same name in the same folder" thing) or rename the original DLL's something else and somehow make the CMS look for
    the new named versions so the system has the updated DLL's it needs to boot/run and the CMS has the old ones it wants to run or is there someway to have a self contained install of the CMS, say on a USB flash drive and give it it's own E:/windows/system32/needed
    dll's  path to the files it needs? 
    Willing to try any other options or settings you may have come up with as well.
    Thanks again for your reply and my apologies for not answering sooner.

  • How to know last access date for the schema's

    Dear all,
    could u plz tell me How to know last access date for the schema’s
    Regards,
    Srinivasa rao.P

    Srinivas,
    could u plz tell me How to know last access date for the schema’s
    In Oracle, we don't access schemas but schema objects.And this informationis not kept anywhere persistantly.As Amit also mentioned,if you do need it,you have to enable Auditing.
    Aman....

  • How can delete my iphone5 data from the date its restored?

    how can delete my iphone5 data from the date its restored?

    it's unclear what you mean
    if you wish to remove your iphone5 data you connect it to iTunes on the computer and click the restore button and choose restore to factory defect

  • How do I recover Apps Data from the iCloud on iPhone 4S with IOS 6.1?

    How do I recover Apps Data from the iCloud on iPhone 4S with IOS 6.1?

    You would have to restore to your entire iCloud backup, if you have one.  (The backup includes app data.)  Restoring to an iCloud backup has to be done in the initial setup process.  If you have any data on your phone now that is not in the backup that you want to save you'll need to do that first.  Then go to Settings>General>Reset and tap Erase All Content and Settings.  You will then go through the setup screens as you did when the phone was new. When given the option, choose Restore from iCloud Backup.  Be sure you are connected to wifi and your charger as this will take some time to finish.

  • How can I restore my datas from the trash ( itunes music)?Thanks

    How ca I restore my datas from the trash( i-tunes) I still can read the lists, but they are not backed. Thks

    Try DataRescue from ProSoft.

  • How can we publish Labview data using the web

    how can we publish Labview data using the web?
    Dr. Eugene Berman, Moran Kamilyan and Ravit Bar

    [email protected] wrote:
    how can we publish Labview data using the web?
    You could use shared variables and publish them to the network or use data sockets.
    Kudos always welcome for helpful posts

  • HT1296 I bought my wife a new Ipad 3. How do I transfer her data from the old Ipad 1 to the new one?

    I bought my wife a new Ipad 3. How do I transfer her data from the old Ipad 1 to the new one?

    Sync the old one, and get a full back up stored.  Make sure you transfer your purchases to I tunes, and make sure you upload any photos taken on the pad, or imported thru the cck.
    Then plug the new pad in, and set it up from the backup of the old one.  In theory, all the stuff that was in the back up will migrate to the new pad.  If apps, music or books get lost, you can redownload them for free, using the same appLe id.  
    If you are selling or gifting the old one,   When you are done and happy with the new set up,  go to setting, general, reset, reset all content and data.  This will place the pad in factory new condition.   Lastly, if it is a 3 g pad, especially if it a Verizon pad, make sure to cancel the plan

  • How do I make a deployment of the Repository in ODI .Desen to Production?

    How do I make a deployment of the Repository in Oracle Data Integrator ? Step by Step? Someone has some sample deployment procedure document?

    How do I make a deployment of the Repository in Oracle Data Integrator ? Step by Step? Someone has some sample deployment procedure document?

  • How to fetch only WebI reports from the repository

    How to fetch only WebI reports from the repository, where in we have Deski reports also in the repository.. any macro??

    here is the query to fetch only webi reports:
    Open Administration Launchpad (.Net / Java) from:
    Start >> All Programs >> BusinessObjects XI Release 2 >> BusinessObjects Enterprise >
    Click on the 'Query Builder' under 'Administration Tools' on the left pane.
    Logon to Query Builder using Enterprise Administrator credentials.
    Run the following query for Web Intelligence Reports:
    SELECT SI_ID, SI_NAME, SI_OWNER FROM CI_INFOOBJECTS WHERE SI_KIND='WEBI'
    Thanks,
    Srikanth.

  • How can I use MY data in the GLV_GigaLabVIEWMemoryStoreAndBrowse.vi?

    Hello everyone,
    As I use large data files (500MB) and need to be able to view them in graphs, I was reading this arcticle about Managing Large Data Sets, and found the GLV_GigaLabVIEWMemoryStoreAndBrowse.vi example in the "Fast Data Display with Decimation" section of it. It is exactly what I need, but, of course, with my data... So, how could I rearrange this file to be able to see not it's own data, but the data I acquired with the TDMS Writer (1D array of waveform data)?
    Thanks,
    Rafael

    There are several options, but I would recommend using the already existing file as your data buffer.  This will replace the internal data structures (queue or functional global) for the main data, not the decimated preview.  I would do it as follows:
    Replace the number of points front panel control with a path control called Filename.  This will allow you to specify your file.
    Modify the command enum so Change NPoints is Change Filename (only needed for us humans).
    In the Value Change event (top loop) for Filename (create one if it is not already there, delete the nPoints one if it is still there), stuff the command queue with Change Filename.
    Create a local shift register in the bottom task handler loop (similar to the one in the traditional memory store and browse) to hold your file reference.
    In the Change Filename frame of the task handler, close the file reference (if it is valid) and open a new file reference using the TDMS functions (use the file name terminal to read the file name).
    Replace all instances of reading or generating the main data with the corresponding TDMS function using the new file reference.  For example, in the Change Filename case, replace the Sine Wave.vi with a TDMS Read.vi which reads the corresponding subset.  Make your chunk size 65,000 points for best speed.
    I have never done this with TDMS (only because I stopped working with file I/O before TDMS was invented), but have done it with raw binary, NI-HWS, and HDF5.  All worked well, so you should have no problems.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to print out a date from the past

    I am trying to print out a date from the past but I cant seem to get It,
    Lets use for example Independece Day,
    How would you write the code in order to print out that exact date?

    Look at the
    [url=http://java.sun.com/javase/6/docs/api/index.html?
    java/util/Date.html]Date APIActually the Calendar class would be better to use, since you can set all the different fields from year to second, plus things like day of week, day of month, week of year, etc.
    too slow
    Message was edited by:
    hunter9000

  • How do you get deleted data from the app Tote M'Notes back on iPad ????

    How do I get deleted data from app Tote M'Notes back???...Not displaying in my notebook anymore...also how do i retrieve data from apps stored in Icloud?

    Why don't you use the fully-qualified-domain-name (FQDN) of your GW and perform a re-direct to this ?
    This should be known (and everytime the same), addtionally you won't have any problems if there's any load balancer in between or in fron of the GWs.
    Secondly you'll have problems to get the IP -address if there's any proxy server involved.
    /ulf

Maybe you are looking for

  • What is wrong with my MacbookPro?

    My computer is a MacbookPro that I bought in 2010. About a month and a half ago I started to experience my computer randomly flashing white with a click and then the screen turning black. When I would hit the power key to turn it back on, it would ch

  • How to select the Printer in Oracle Reports 6i R2 (Windows 7)

    Hi, In a client site they have more than one printer suppose one is dot matrix and other one is laser printer or some other brands. They take printouts in both. Recently I installed Oracle Forms & Reports 6i R2 Runtimes in some Windows 7 32 bit PCs.

  • Global Temporary Table Space

    Hi Can any one give me some information about GLOBAL TEMPORARY TABLE. Thnx & Regards Sunil

  • Re email address if you leave

    Hypothetical. If person leaves BT broadband is there a way to keep the BT address ? Life | 1967 Plus Radio | 1000 Classical Hits | Kafka's World Someone Solved Your Question? Please let other members know by clicking on 'Mark as Accepted Solution' He

  • Trying to get Xinet XMP data

    Hi Everyone, I'm trying to create a slug script for InDesign CS3 that retrieves custom Xinet metadata from a custom XMP panel.  I was able to complete this task in Illustrator CS3 by using the following code to connect to the XMP data: // load the li