Best way to extract this info?

Hello:
I have information stored in xmltype as follows:
<INFO>
<ASG>
<LMT id="A1">
<LMT_VAL>7</LMT_VAL>
</LMT>
<LMT id="B1">
<LMT_VAL>6</LMT_VAL>
</LMT>
</ASG>
</INFO>
The above info may be dynamic. Example, for some types, There may be additional LMT element with a value of C1 and D1. So what is the best way to extract all of them (A1, B1, C1, D1) - even though in some cases only A1 and B1 may be present?
Do I have to extract like:
select ...
where
t1.xml.col.extract('/INFO/ASG/LMT/LMT_VAL/@id').getStringVal() = 'A1'
Do I have a condition like this where ... = A1
Any help appreciated.

Hi,
one left round bracket is missing
TABLE(xmlsequence(extract (<b> (</b><---missing SELECT xml_column FROM your_table)....If you have more then one row in the table it's not working!
SQL> CREATE TABLE test_xml(
  2   id NUMBER
  3  ,xml_col XMLType)
  4  /
Table created.
SQL> INSERT INTO test_xml VALUES(1,xmltype('<INFO>
  2  <ASG>
  3  <LMT id="A1">
  4  <LMT_VAL>7</LMT_VAL>
  5  </LMT>
  6  <LMT id="B1">
  7  <LMT_VAL>6</LMT_VAL>
  8  </LMT>
  9  </ASG>
10  </INFO>'))
11  /
1 row created.
SQL> INSERT INTO test_xml VALUES(2,xmltype('<INFO>
  2  <ASG>
  3  <LMT id="A1">
  4  <LMT_VAL>7</LMT_VAL>
  5  </LMT>
  6  <LMT id="B1">
  7  <LMT_VAL>6</LMT_VAL>
  8  </LMT>
  9  </ASG>
10  </INFO>'))
11  /
1 row created.
SQL> SELECT extractvalue(column_value, '/LMT/@id') new_id,
  2         extractvalue(column_value,'/LMT/LMT_VAL') new_value
  3  FROM TABLE(xmlsequence(extract ((SELECT xml_col FROM test_xml), '/INFO/ASG/LMT')));
FROM TABLE(xmlsequence(extract ((SELECT xml_col FROM test_xml), '/INFO/ASG/LMT')))
ERROR at line 3:
ORA-01427: single-row subquery returns more than one row
SQL> spool off;

Similar Messages

  • What's the best way to store my info externally

    I have recently bought my first Macbook Pro 13" with 2.4 Ghz. I am currently using it for my own business and do tend to get a lot of files together. I went to look at "About this Mac" and have already got 369 Gb used up in storage... I have no idea how I have done that as I have hardly downloaded any apps on this computer besides the ones that were on here. I did download Vware Fusion 4 as I have a reservation system which I used to run on my pc and need to have this on here too so perhaps that software takes a lot of space.
    Could anyone advise on which is the best way to store my info externally, will any external harddrive do, or do you need a special one for Apple or Macbook pro. I am just asking as I have no idea and prefer to buy the right one straight away.
    Any help would be much appreciated !
    Thanks, Sara***

    Sara,
    The most reliable method is to use an external hard drive.  Some are better than others, but most will work.
    For the least amount of setup pain, I prefer to deal with the Mac specialists at OWC, http://www.macsales.com as they stand behind their products with great warranty and support.  I have one of their Mercury Elite Pro 2 TB drives that has multiple interface capability so you can get a fast interface for data transfer.
    Take a look at what they offer and see what fits your needs.  If you have more questions about doing thin, just ask on here.
    Ralph

  • HT1338 best way to extract a video from a website?

    what is the best way to extract a video from a website? THANKS!

    how bout a bit more thought on this one, some people are trying to pull a video clip from their 15 seconds of fame on channel 7 news,
    or perhaps a short intro video clip, on a site they own becuase it is playing as flash. since they never had hard copy of the video clip, its difficult to ask themselves for permission, if they don't know how, which is, i'm sure, why this fellow did indeed ask.
    no such thing as dumb questions...just helpful ones that others may also wonder.

  • Best way to extract XML value wiith an xpath

    Hello,
    I wonder what is the best way to extract text value from XmlType with an xpath.
    I need to insert a row inside a table where the row's data come from xpath extractions of an XmlType. I do a lot of (approximative 20) :
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elem1').
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elemI').
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elem20').
    inside the insert statement
    Is this way is the best or is there a more optimal way ?
    For example extracting the node '/an/xpath/to/extract/' and sarting from this node extracting "elem1", ... , "elemI", "elemN" children.
    Thanks for your help,
    Regards,
    Nicolas

    Hi Nicolas,
    The answer depends on your actual storage method (binary, OR, CLOB?), and db version.
    You can try XMLTable, it might be better in this case :
    SELECT x.elem1, x.elem2, ... , x.elem20
    FROM your_table t
       , XMLTable(
          '/an/xpath/to/extract'
          passing t.myxmltype
          columns elem1  varchar2(30) path 'elem1'
                , elem2  varchar2(30) path 'elem2'
                , elem20 varchar2(30) path 'elem20'
         ) x
    ;

  • Best way to extract all images from Messages?

    My iPad freaked out earlier today and unfortunately I had to do a recovery and restore (from iCloud backup).  I say unfortunately because I was 90% certain I was not backing up photos/video (and there was no way to check before doing the restore).  And indeed I had photo/video backup turned off.
    I'm mostly back to normal now, except for all the lost photos/videos.  I've gone through some of Messages to Save ones I sent there. 
    What is the best way to extract all images from past Messages so I don't have to tediously load earlier messages?   I understand there are some programs that allow one to go through a local backup and go through messages.  But for this I suppose I'd first need to make a local backup of everything, no?  Are those programs able to extract just images I've sent or do they grab everything (i.e. images others have sent me?)
    Related, before I did the initial restore could I have easily retrieved the photos/images on the device through some third-party solution?
    Lastly, and semi-off topic.. What determines the image name for an image in Messages?   For example, I Copied a photo someone sent me via Messages and Pasted it three times back to her (all at the same time).   The image filenames are IMG_6447.jpg,  IMG_4820.jpg, IMG_0291.jpg.  

    Thanks Kirby.  I utilize Aperture 3 by reference instead of a compiled library.  So I have individual folder/projects stored on my laptop.  By exporting as a library, does Aperture bring these folders and related images "with it"?
    What I don't want to lose is any post processing I do in the field which creates separate versions and/or .PSD files.
    Thanks for your continued assistance.
    Chris

  • Best way to extract XML data to DB

    Hello,
    In our work we need to extract data from XML documents into a database. Here are some extra notes:
    + There is no constant schema for the XML documents.
    + Some processing on the XML files is required.
    + The XML documents are very big.
    + The database is Oracle 8i or 9i (Enterprise Edition both) and our framework is NET.
    Our questions are:
    1. What is the best way to extract the data into the database under the above circumstances ?
    2. In case there was a constant schema for the XML documents, would there be a better way ?
    3. Is writing the data to text files first, and then loading it via SQL-Loader is an effective way ?
    Any thoughts would be welcome. Thanks.

    Hi Nicolas,
    The answer depends on your actual storage method (binary, OR, CLOB?), and db version.
    You can try XMLTable, it might be better in this case :
    SELECT x.elem1, x.elem2, ... , x.elem20
    FROM your_table t
       , XMLTable(
          '/an/xpath/to/extract'
          passing t.myxmltype
          columns elem1  varchar2(30) path 'elem1'
                , elem2  varchar2(30) path 'elem2'
                , elem20 varchar2(30) path 'elem20'
         ) x
    ;

  • What is the best way to protect my info in case my iPad is stolen

    Ideas for the best way to protect my info I'd my iPad is stolen or lost?

    I also had my iPad stolen, and thats when other troubles started! I received an email on my PC stating that my iTunes password had been reset.  The thief had done this!  So I rang the Apple help line to ask what to do. they said just reset the password, and as the thief couldnt access my emails it would be okay,,the Apple emails also suggested this.   But that was the issue that stupid me hadnt realised!!! As the iPad was receiving my emails the the thief could easily reset the iTunes password , and download muic and videos on my credit card on iTunes!!         As happened to me.
    Apple does not warn you of this possibility, even when i spoke to their Help line. And searched their website for advice
           So, my advice is, Do Not store your email password on your iPad, and  maybe, do not leave your credit card details with iTunes? An irritation I know! If you have not done these things, then if your iPad is stolen then immediately change your email password, and stop your iTunes credit card.
         Probably iTunes need a safer way to change passwords, like an sms code to allow password changes, as relying on emails is not safe, as the thief will frequently be receiving those emails too!!!

  • What is the best way to remove all info from a MacBook Pro before passing it along to someone else?          passing it on to someone?

    What is the best way to remove all info from a MacBook Pro before passing it on to someone else?

    Read this: http://www.tuaw.com/2010/09/24/mac-101-preparing-your-old-mac-for-sale-or-recycl ing/

  • What is the best way to extract/consume HR data to and from Peoplesoft?

    I have to do integration between Peoplesoft and Oracle ERP to send HR data from Peoplesoft to Oracle HRMS. I will use Oracle Fusion Middleware for building the interface. I don't have much experience in working with Peoplesoft tools, like PeopleTool, App Engine, Integration Broker, Component Interface and Oracle adapter for Peoplesoft. Can somebody please let me know what is the most popular or recommended or best way to extract HR data from Peoplesoft.
    The second interface will consume some HR data from Oracle. Once again I need to know different ways to insert data into Peoplesoft.
    I appreciate if you can share your experience for the above two scenarios.

    If you plan on buying a apple laptop you have two options. You can use time machine or pull the data off of it directly and put it onto the external. I advise the second choice. This way you do not have stuff that you dont need filling up the space on your new drive. Get your applications, music, documents, photos, videos and perhaps downloads and desktop; Put all of these on your external. And then reinstall osx onto your drive.
    *** If buying a windows machine next check the format of the drive in disk utility. You will need a program called Paragon NTFS to format the drive window compatibility. You have to pay for the free version but can download a trail version for free.
    http://www.paragon-software.com/home/ntfs-mac/
    Did i leave anything unanswered?

  • SD reporting- best way to extract SD contracts data

    Hi All,
    I want to know what is the best way of extracting the SD contracts data from the VEDA table & the technical objects attached to the contracts(which are in tables like SER02, OBJK etc..). Is it possible to enhance the 2LIS_11_VAITM datasource with these fields? or there is a better way of doing this? Is there a standard datasource that can be used?
    Any helpful information will be appreciated.
    Thanks,
    Shilpa

    You can create a User Exit in CMOD for the 2LIS_11_VAITM DataSource to get the data. There should be a 1:1 (equi or inner join) or 0:1 (outer join) relationship of the data that you want to include, so that you don't create duplicate data.
    Another option would be to create generic DataSources and join the data in BW.

  • Best way to record GPS info in Aperture

    Each time I take a batch of photos with my Nikon D60 I take a photo with my iPhone 4S to record the location. What's the best way to get this GPS info into Places in Aperture? Or should I bother using the iPhone at all and use another method of recording the location in Places? I shoot wildlife with an extreme telephoto lens, so I can't use the iPhone alone for this type of photography. I am told there are stand alone devices for this, but some kind of batch copy of the metadata from the iPhone seems to make sense. Any easy ways to accomplish this?

    A very easy way to transfer the gps from your iPhone image to the wildlife images taken with the other camera is the Lift&Stamp HUD. Import your iPhone image with EXIF GPS-tags, then lift all tags from this image, deselect all but the GPS coordinates in the Lift&Stamp HUD, select the images taken at the same location in the browser, and click "Stamp selected Images".
    The versions will now be stamped with the same GPS data.
    You may also display the images you want to geocode together with your iPhone image in "Places" View anddrag all images taken at the same location to the pin of the  iPhoto image on the map in "Places" View,
    But there is one draw-back: both mehods will only geocode the current version, the gps witll not be written to the original master files.
    If you want your master files to be geocoded, you will have to assign the GPS tags before you import your images into Aperture.  For example, I record the gps tracks with a Garmin gps or an AMOD tracker, and geocode the master image files using Geotagalog or Jetphoto Studio, before I import them into Aperture. You could do the same with the free exiftool (commndline tool).
    Regards
    Léonie

  • My old computer is dying and I want to transfer my account to my new computer.  I will not be using the old computer at all.  What is the best way do do this?

    I want to stop using my old computer completely and transfer my itunes account to my new computer.  What is the best way to do this?

    A simple search

  • My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    Have a look here...
    what-to-do-when-your-hard-drive-is-full.html

  • TS1314 I have lots of organized photos on my PC and I want to keep them organized to sync to ipad.... how is the best way to do this?

    I have spent a lot of time saving, organizing and arranging photos (for the last 7 years) on my PC, and would like to know the best way to transfer these, AND MAINTAIN THE ORGANIZATION OF THE FOLDERS, to my new ipad (and later, my iphone). I have a really good system, and I do not want to have to do it all over again, on the ipad. I DO NOT want to subscribe to another monthly service fee (i.e. the iCloud) but DO have iTunes on my PC.
    What is the simplest method to do this ?  I have tried synching, but, each time have lost photos (on my ipad) OR have had NO ORGANIZATION AT ALL to the photos once synced.  I have all these photos (5.6gb) in the My Pictures folder, then subdivided into years, then subdivided into events and months within the years.  So, my transfer of the My Picures folder, completely transfers all of them, but with NO further organization.  Again, I have spent years doing this, and don't want to have to re-invent the wheel. 
    Can someone advise (or even better, lead me to a youtube video) that accurately shows the best way to do this ?
    Thank you, in advance, for your help.
    p.s.  I particularly enjoy Dan Nations very informative articles on how to get the best from my products.  And, wish Apple would explain "how it works" regarding the syncing methods on the Operating System.  It is the only thing I "don't get" about using my iPad..... meanwhile I LOVE my new mini ! ! ! ! ! ! ! thanks Apple, for keeping things simple.... Please don't change that !

    Correct, it will only be one-level, the Photos app doesn't support sub-albums - the sub-folders photos will be included in the parent's album.
    If you select My Pictures at the top of the Photos tab when syncing, then you should get an album for each folder that is directly under it - so if I understand correctly what you described then that would mean an album for 2013, one for 2012 etc. And each of those should include all the photos in the subfolders under it - so 2013 would include the photos from the events and months subfolders under it.
    You can't sync them separately, only the contents of the last sync remains on the iPad, by not including a folder in the next photo sync you are effectively telling iTunes that you no longer want that folder/album on the iPad so it will be removed and be replaced by the contents of the new sync (you can't delete synced photos directly on the iPad, instead they are deleted by not including them in the next sync).
    The app that I use, Photo Manager Pro, allows you to select and copy a folder (via FTP), but you would need to select each subfolder individually, which if you have a lot would be time-consuming (I think that if you select '2013' it would ignore the folders beneath it).

  • I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. What is the best way to do this

    I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. Even when I save it, the image quality at minimum the file size is 10.9 MB. What is the best way to do this

    @Barbara – What purpose is that PDF for? Print? Web?
    If web purpose, you could convert CMYK images to sRGB. That would reduce the file size as well.
    A final resort to bring down file size is:
    1. Print to PostScript
    2. Distill to PDF
    That would bring file size down even more. About 20%, depending on the images and other contents you are using, compared with the Acrobat Pro method. If you like you could send me a personal message, so we could exchange mail addresses. I could test for you. Just provide the highres PDF without any downsampling and transparency intact. Best provide a PDF/X-4.
    I will place the PDF in InDesign, print to PostScript, distill to PDF.
    Uwe

Maybe you are looking for

  • Upgrade for HP Pavilion HDX9300 CTO Notebook PC

    Good morning people! I have one HP Pavilion HDX9300 CTO Notebook PC and have some questions: I am wanting to upgrade my HD drive for a SSD model and increase my DDR memory. I know my memory operates at a frequency of 667 MHz but need to know if my no

  • VRF not work

    Hello! We have cat3550 12.1(19)EA1a and we want to setup VRF in next scheme: cat3550------(inside)PIX(dmz)----r2600 ------------tunnel1------- r2600 is a exit point of all tunnels and is a point of connection VRF and global routing. There are two sub

  • Recording Flash with iShowU and importing into FCP?

    I need to create some motion graphics for a video, though I am not good enough yet with Motion and would like to use Flash. I am wondering if there are any issues with creating my project in Flash, playing it back and recording it with iShowU and jus

  • Problem with a procedure and an  agent

    Hi Guys, I created a local agent and use it to run a procedure that works Ok When I run the procedure using the agent it still working for a long time I tried to stopped but I can not. So I delete them. After that always I run the procedure despite o

  • Action Script Help (Flash 8 ONLY)

    My department currently has a host of training videos we use for online courses. Of course, these are all being delivered as FLVs. Through the Developer's communities, I found a script that allowed me to add a caption file to the video (XML). Now I'd