UDT's and Retrieving them

How do we retrieve a specific column within a UDT
For example we have a table Employees and within that table is a column Address and the address is a UDT with city, country, etc
How can i retrieve the country only?

SQL> create type Address as Object (
  2    city varchar2(50),
  3    state varchar2(2)) ;
  4  /
Type created.
SQL> create table Addr_Book (Name Varchar2(20), addr Address) ;
Table created.
SQL>
SQL> insert into Addr_Book values ('SAMPLE', Address('Any City', 'AA')) ;
1 row created.
SQL>
SQL> select t.addr.city from addr_book t ;
ADDR.CITY
Any City
1 row selected.
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL>

Similar Messages

  • My contacts are not updating from the iCloud. How can I actively go and retrieve them?

    My contacts are not updating from the iCloud even with "push" on. How can i actively go and retrieve them?

    Hello there, Lk354.
    The following Knowledge Base article offers up some great recommendations for troubleshooting issues with using iCloud Contacts:
    Get help using iCloud Contacts
    http://support.apple.com/kb/TS3998
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Need an app or a script to find a list of files and retrieve them

    A few years ago at an old job I used an application that could search a hard drive for a list of images all in one shot. The names of the images were typed into a txt file. the text file was used as the search list and the application would report back if the images were found and it would retrieve them. Where can I get my hands on something like This or can it be built in Automator?

    'I used an application that could search a hard drive for a list of images all in one shot ... and it would retrieve them.' - desired result is too vague.
    'Where can I get my hands on something like this ... - perform a 'Google' or equivalent search.
    "... or can it be built in Automator?' - possibly yes.
    On your behalf the above request is re-written below.
    Can someone assist me in AppleScript scripting. I am trying to open a '.txt' file which lists on each line a file to search for, and if found - to open its containing folder. Is such a process also possible with 'Automator'? Thank you for any assistance.
    One possible AppleScript solution:
    -- Code starts here --
    set tFile to read (choose file) -- One was to obtain the file, to open.
    set tPars to paragraphs of tFile -- create a list of paragraphs of selected file.
    repeat with i in tPars -- Cycle through the list of paragraphs.
    with timeout of 0 seconds -- Prevent AppleScript timeout error.
    set tItems to paragraphs of (do shell script ("locate " & (quoted form of i))) -- Obtain list of found filename files.
    end timeout
    repeat with j in tItems -- Cycle through the list of found file.
    try
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"} -- Extract container of file.
    set fPath to text items 1 through -2 of j
    set AppleScript's text item delimiters to "/"
    set fPath to fPath as string
    set AppleScript's text item delimiters to oAStid
    do shell script ("open " & fPath) -- Open container of file.
    end try
    end repeat
    end repeat
    -- Code ends here --
    If the above sample code is not exactly what you seek - then edit the code accordingly; and / or post requests with specific details.
    'Is such an action also possible with 'Automator'?' - please post an properly constructed request to the 'Tiger - Automator'
    forum.

  • If my photos are saved to my I cloud can I delete them of my phone and retrieve them again later

    If my photos are backed up to my I cloud can I delete them of my phone and be able to retrieve them at a later date?

    Read this Discussion...
    https://discussions.apple.com/message/22184833#22184833
    More Info
    See  >  Photo Stream FAQ
    From Here  >  http://www.apple.com/support/icloud/photo-stream/

  • Passing Parameters and Retrieving them

    Hi,
    I am trying to learn the JSC2 IDE.Would like to pass a parameter from all my JSP pages.I will have to retrieve this parameter and use it for further processing.I have two things here.
    1.How to pass parameters from say from a hyperlink.
    2.How to retrieve them and use it fro further processing.
    Hope to hear from you.
    Thanks.
    ramdsp.

    Hi,
    Go through the tutorials "Sharing Data Between Two
    Pages" and "Understanding Scope and Managed Beans".
    These are available at:
    http://developers.sun.com/prodtech/javatools/jscreator
    /learning/tutorials/index.jsp
    These should be of help to you
    Cheers
    GirishI do understand how to share data between two pages!
    I just don�t know (the best way) to keep request variables between multiple requests (without using session variables).
    Question: What would happen if I had one button on the last page of the tutorial "Sharing Data between Two Pages". I mean, that button would make a post on the same page and would try to get data from the request bean (which does not exist anymore).
    Best regards,
    Nuno Ferreira

  • How to store images in database and retrieve them back to page?

    Well I don't know how to store an image file to a database (say MSSQL) from the JSP and retrieve it back whenever needed and put it on the JSP page? Please help me.

    I am not sure how to store images in database but what you can do is store the image into particular folder using FileOutputStream and its unique name into the database...and than retrieve it from the folder using that name retrieved from database...
    <%
    response.setContentType("text/html");
    response.setHeader("Cache-control","no-cache");
    String err = "";
    String lastFileName = "";
    String contentType = request.getContentType();
    String boundary = "";
    final int BOUNDARY_WORD_SIZE = "boundary=".length();
    System.out.println("contentType --> "+contentType);
    System.out.println("BOUNDARY_WORD_SIZE --> "+BOUNDARY_WORD_SIZE);
    if(contentType == null || !contentType.startsWith("multipart/form-data"))
    err = "Ilegal ENCTYPE : must be multipart/form-data\n";
    err += "ENCTYPE set = " + contentType;
    else
    boundary = contentType.substring(contentType.indexOf("boundary=") + BOUNDARY_WORD_SIZE);
    System.out.println("boundary --> "+boundary);
    boundary = "--" + boundary;
    try
    ServletInputStream sis = request.getInputStream();
    byte[] b = new byte[1024];
    int x=0;
    int state=0;
    String name=null,fileName=null,contentType2=null;
    java.io.FileOutputStream buffer = null;
    while((x=sis.readLine(b,0,1024))>-1)
         System.out.println("************ x ********** "+x);
         String s = new String(b,0,x);
                   System.out.println("************ s ********** \n"+s);
         if(s.startsWith(boundary))
         state = 0;
         System.out.println("name="+name);
         System.out.println("filename="+fileName);
         name = null;
         contentType2 = null;
         fileName = null;
         else if(s.startsWith("Content-Disposition") && state==0)
              System.out.println("-- 1 --");
              state = 1;
              System.out.println("s.indexOf(filename=) --> "+s.indexOf("filename="));
              if(s.indexOf("filename=") == -1)
                   name = s.substring(s.indexOf("name=") + "name=".length(),s.length()-2);
                   System.out.println("after name substring 1 "+name);
              else
                   name = s.substring(s.indexOf("name=") + "name=".length(),s.lastIndexOf(";"));
                   System.out.println("after name substring 2 "+name);
                   fileName = s.substring(s.indexOf("filename=") + "filename=".length(),s.length()-2);
                   System.out.println("fileName --> "+fileName);
                   //String fileName1 = s.substring(s.indexOf("filename=") + "filename=".length(),s.length());
                   //System.out.println("fileName1 -->"+fileName1);
                   if(fileName.equals("\"\""))
                   fileName = null;
                   else
                        String userAgent = request.getHeader("User-Agent");
                        System.out.println("userAgent --> "+userAgent);
                        String userSeparator="/"; // default
                        if (userAgent.indexOf("Windows")!=-1)
                        System.out.println("test --> "+"\\");
                        userSeparator="\\";
                        if (userAgent.indexOf("Linux")!=-1)
                        userSeparator="/";
                        System.out.println("userSeparator "+userSeparator);
                        System.out.println("fileName before inserting userSeparators "+fileName);
                        fileName = fileName.substring(fileName.lastIndexOf(userSeparator)+1,fileName.length()-1);
                        System.out.println("fileName after userSeparators "+fileName);
                        if(fileName.startsWith( "\""))
                        fileName = fileName.substring( 1);
              name = name.substring(1,name.length()-1);
              System.out.println("name 2 --> "+name);
              System.out.println("final file name "+fileName);
              if (name.equals("file"))
                   if (buffer!=null)
                   buffer.close();
                   lastFileName = fileName;
                   buffer = new java.io.FileOutputStream("/Documents and Settings/sunil/Desktop/images/"+fileName);
         else if(s.startsWith("Content-Type") && state==1)
                             System.out.println("-- 2 --");
              state = 2;
              contentType2 = s.substring(s.indexOf(":")+2,s.length()-2);
              System.out.println("contentType2 --> "+contentType2);
         else if(s.equals("\r\n") && state != 3)
                   System.out.println("-- 3 --");
              state = 3;
         else
              System.out.println("-- 4 --");     
              if (name.equals("file"))
              System.out.println("Final x :: "+x);     
              buffer.write(b,0,x);
    }     // while closing
    sis.close();
    buffer.close();
    }catch(java.io.IOException e)
    err = e.toString();
    boolean ok = err.equals("");
    if(!ok)
    out.println(err);
    else
    %>
              <SCRIPT language="javascript">
              history.back(1);
              alert('Uploaded <%=lastFileName%>');
              window.location.reload(false);
              </SCRIPT>
    <%
         out.println("done");
    %>
    </BODY>
    </HTML>
    I think it will solve ur problem..

  • Storing an array of checkbox booleans into preferences and retrieving them

    Just wondering how to go about storing an array of JCheckBoxes into a preference and retrieving it. There's 32 checkboxes so if they select, say, 6 of these randomly it should store it in a preference file and retrieve it when the application is loaded so that the same 6 checkboxes remain selected. I'm currently getting a stack overflow error, though.
    import java.util.prefs.*;
    public class Prefs {
         Preferences p;
         GUI g = new GUI();
         public Prefs() {
              p = Preferences.userNodeForPackage(getClass());
              g = new GUI();
         public void storePrefs() {
              for (int i = 0; i < g.symptoms.length; i++) {
                   p.putBoolean("symptoms", g.symptoms.isSelected());
         public void retrievePrefs() {
              for (int t = 0; t < g.symptoms.length; t++) {
                   p.getBoolean("symptoms", g.symptoms[t].isSelected());
    symptoms is the array of checkboxes in the GUI class. Not sure where I am going wrong here. I can do it with strings from textfields etc but this is proving to be an annoyance. :(
    Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Actually, I have a better example, see below
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.util.prefs.*;
    public class PreferencesTest {
        private Preferences prefs;
        public static final String PREF_OPTION = "SELECTED_MENU_ITEM";
        public void createGui() {
            prefs = Preferences.userNodeForPackage(this.getClass());
            JMenuItem exitAndCloseMenuItem = new JMenuItem("Exit");
            exitAndCloseMenuItem.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e) {
                    System.exit(0);
            JMenu fileMenu = new JMenu("File");
            fileMenu.add(exitAndCloseMenuItem);
            JCheckBoxMenuItem[] preferenceItems = {
                new JCheckBoxMenuItem("pref 1"),
                new JCheckBoxMenuItem("pref 2"),
                new JCheckBoxMenuItem("pref 3"),
                new JCheckBoxMenuItem("pref 4")};
            int selectedMenuItem = prefs.getInt(PREF_OPTION, 0);
            preferenceItems[selectedMenuItem].setSelected(true);
            ButtonGroup preferencesGroup = new ButtonGroup();
            JMenu preferenceMenu = new JMenu("Preferences");
            for(int i = 0;i<preferenceItems.length;i++){
                preferenceItems.setActionCommand(Integer.toString(i));
    preferenceItems[i].addActionListener(new menuItemActionListener());
    preferencesGroup.add(preferenceItems[i]);
    preferenceMenu.add(preferenceItems[i]);
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(fileMenu);
    menuBar.add(preferenceMenu);
    JFrame f = new JFrame("Prefernce Test");
    f.setJMenuBar(menuBar);
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    public static void main(String[] args){
    new PreferencesTest().createGui();
    class menuItemActionListener implements ActionListener{
    public void actionPerformed(ActionEvent e) {
    JCheckBoxMenuItem jcbm = (JCheckBoxMenuItem)e.getSource();
    prefs.put(PREF_OPTION, jcbm.getActionCommand());

  • Put Hibernate Objects in f:selectItems and retrieve them after submit

    Hi,
    My question is if there is a convenient way to put a list of hibernate objects in combobox and retrieve the selected one after the user submitted the form.
    What I do now is this:
    I retrieve a list of Hibernate objects and create a list of selectItems, using their id as the value and their name as the description.
    Example:
    public List<SelectItem> getCountries() {
              List<SelectItem> re = new ArrayList<SelectItem>();
              for (Country countries : this.dao.getCountries()) {
                   Short id = countries.getIsoCountrycode();
                   String desc = countries.getName();
                   SelectItem item = new SelectItem(id, desc);
                   re.add(item);
              return re;
    In the save-method i use another dao method to retrieve the country object by using the id (isocountrycode). This seems very inefficient to me, as i retrieve the country object which i already have in memory to feed the combobox in the first place.
    Is there a better way?
    Thanks in advance.

    Looks like I and BalusC interpreted your questions differently.
    The way I have implemented this case is to have get and set methods for the selectedProperty in my bean.
    I also have the change propertyChanged method that sets the session attribute whenever the user changes the selection.
           public String getSelectedPropertyType() {
                return this.selectedPropertyType;
           public void setSelectedPropertyType(String selectedPropertyType) {
                this.selectedPropertyType = selectedPropertyType;
                HttpServletRequest request = getHttpRequest();
                request.getSession().setAttribute("selectedPropertyType", selectedPropertyType);
           public void propertyTypeSelectionChanged(ValueChangeEvent event) {
                if (event.getNewValue() == null) return;
                String newValue = (String) event.getNewValue();
                setSelectedPropertyType(newValue);
           }Whenever you need the currently selected property, you would just need to get the #(myBean.selectedProperty).
    If you find a simpler solution than this, please let me know.

  • Using Access to store OLE objects like Excel , Word docs and retrieve them

    Hi folks,
    I need a solution for this problem guys.
    The logic is like this : A portable exe file and a database. Database contains files stored ( embedded ) in it like Excel , Word , notepad etc.
    On running the exe file and giving necessary prompts or combo entries, it should display all files related to the selection and On clicking the link the document should open itself.
    Why I use Access : Most of the PC contains MS Office. Otherwise I have to use a lightweight protable database.
    Also it should be able to store files into it. As far as I know , Access can store excel and images etc. Is there any other protable db capable of storing excel and word docs.
    After storing how do I retrieve the file. I have read about displaying images. What about excel files...

    Portable as in the sense every one can cary the file and the MS access database and can access data whenever they want . They can carry it in their flash drive / USB drive. Only the data base would get updated with the data. So in effect , One could access the updated documents by the means of a query.
    This should work in Windows environment

  • How to Store bollean selection values and retrieve them in runtime?

    I have an array of bolleans representing a channel of a device. Now , when the user turns on the channel the selected channel array are supposed to be stored. Now when the user selects device 2 (using a ring function) the list refreshes t5he channel names and resets the bollean array to their default values and the new selection values are to be stored. Now if the user wants, he should revert back to device 1 and can review what all channels he had selected for Device 1. How can this functionality be achieved?
    Labview Learner
    Attachments:
    1.PNG ‏14 KB
    2.PNG ‏14 KB

    You need to store the boolean array somewhere.  I would likely just use a shift register
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to add dynamic name value pair to html link and retrieve them?

    *topic
    Someone, please help me with a code example. A simple example will do.

    And the setClientAttributes() takes Set object, so i added ClientAttributeTag and then set it in HashSet. Is this the way to do it ??
    and how can i set string value in ClientAttributeTag.setValue() ??
    Please help.
    Sudeep

  • How to insert and retrieve zip files in to blob column in oracle database?

    Hi All,
    I have a requirement where i need to insert zip files to BLOB and retrieve them.
    Please suggest me any good example or redirect me to them.

    You already have a post on this subject here: read and write compressed data from blob in ADF
    Please do not post duplicate questions.

  • How to save and retrieve 3D data

    Hi, all:
    I have several 3-D data and each one has a very large and different size. I saved them in 1D using Write to binary file after reshaping the data, and retrieve it after the user key in the size of the data so that my code can reshape the data into a correct size.
    My first question is, is there any way to save the data directly into a 3D format so that the user can retrieve the data without knowing the size? For example, I have the data A in 55(row)x512(column)x500(frame) and the data B in 3(row)x1004(column)x1500(frame). Is there any way to save and retrieve them without the need to know their size in advance?
    My second question is, I will generate several data set like this and save and retrieve them during data collection. I found that it always takes a long time to save the data, and longer time to retrieve the data. Is there any way better than saving in binary to reduce the time?
    I am using LV 8.2. I tried to search the previous posts for the answers but found that some downloaded examples gave me a warning that my current version couldn't support the function.
    I would very appreciate for any suggestion and example code to help me. Thank you in advance.

    By default, LabVIEW will prepend the array size when you write binary data, so all you need to do is wire an empty 3D array of the correct type to the "data type" input when you use "read binary file" and everything will fall into place. Have you tried?
    (Edit: Ahhh, Smercurio... was faster once more. ) 
    Message Edited by altenbach on 09-04-2008 02:32 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    3DBinary.png ‏6 KB

  • Loosing files so why can't I retrieve them from icloud?

    I am randomly getting messages that itunes cannot locate files. I have Icloud and they are all on there! Why can't I go to icloud and retrieve them? What is the point of icloud if you can't get your music off it??

    Hello Lisa.madison,
    How did you do the import from iPhoto? Did you export/ share them from iPhoto to the disk and import them from there to Aperture? That would explain the reduzed quality and resolution.
    Aperture offers two mechanisms to import iPhoto pictures - both are  accessed  from the Aperture main menu    File -> import
    The iPhoto Browser: -  File -> import - Show iPhoto Browser
    This option lets you select and import indiviual photos in iPhoto. Both, the masters and versions are added to your Aperture Library as managed import.
    Import iPhoto Library: - File -> import -  iPhoto Library
    You import the whole library, and you can choose if you want to add the masters managed or referenced.
    With both these options you will preserve all the quality/resolution available in iPhoto; Aperture will import the masters and any versions, and so some pictures may appear to be duplicated after the import. You will be able to tell by the keywords if you are looking at an original master or a version.
    Regards
    Léonie

  • I want to store and retrieve images from a oracle datrabase's BLOB type

    Hi all
    I am using WebLogic and Oracle 10g.I have to store images and retrieve them from a BLOB type.
    Please help .

    Please have a look to the Database Application Developer's Guide - Large Objects
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm

Maybe you are looking for