Retrieving Stuct attribute names

I have a user defined type that is an array of another type. The underlying type has 5 fields. I am able to get their values by using the getAttributes() method, however, I am unable to identify the actual field names.
Does anyone know how to get the names of the attributes in a user-defined type?
My user-defined type comes back through JDBC as a Type.ARRAY. I then use the getResultSet() of the Array class. Next, I use the getResultSetMetaData() of the ResultSet class. That only gives me two columns: Rownum and SYS_NC_ROWINFO$. The latter is of Type.STRUCT. Within the Struct class, you perform the getAttributes() method which returns an array of Objects. From there I can get the values but I don't know how to get the names of the fields those values are representive of. I was hoping to find a getAttributeNames() method, but it doesn't seem to exist.

use oracle.sql.STRUCT and then get the oracle.sql.StructDescriptor from that and get the ResultSetMetaData from that and use the getColumnName() method from the latter to get your name.

Similar Messages

  • How to retrieve child attribute names in XML?

    How do I retieve only the child attribute names from the XML.
    XML:
    <catalog>
         <book>
               <author></author>
               <title></title>
               <genre></genre>     
               <price></price>    
         </book>
    </catalog>Expecting result:
    author
    title
    genre
    price
    I tried with the SAX Parser and class extending DefaultHandler it returns catalog and book aswell which I do not want to retrieve.
    public void startElement(String namespaceURI, String localName,
                                     String qName, Attributes atts)  {
                   System.out.println(qName)
    //this returns catalog and book along with the other attribute names
    }

    gsry wrote:
    jverd wrote:
    Your problem is not clear. Are you saying you want only the leaf nodes? Or are you saying you want all the /catalog/book child nodes, even if they're not leaf nodes? Or something else?I do not know what leafy nodes mean but i want to retrieve all the child nodes (tag names).
    <catalog>
         <book1>
               <author1></author1>
               <title1></title1>
         </book1>
         <book2>
               <author2></author2>
               <title2></title2>
         </book2>
    </catalog>In this example i want to retrieve author1, title1, author2, title2
    Also, you're still not specific enough. For instance, what if there's another layer before author and title. Do you want that? What about if there's another level under author and title, do you want that? Can those situations even happen?
    Do you want nodes at a certain level?
    At a certain level and below?
    Always author and title nodes, regardless of where they appear?
    Always author and title, but only if they're immediately enclosed by book? Or by book<some number>?
    Author and title only when they're under /catalog/book?
    If you can't specify your requirements precisely, it's going to be awfully hard for someone to help you.

  • Help in retrieving the element attribute name and value..

    Hi have to retrieve the attribute name and value from the element.....
    requirement is like this
    <ws:GetRightNowProductViewByDivisionResponse xmlns:ws="http://ws.sage.co.uk/">
    <ws:GetRightNowProductViewByDivisionResult ProductID=" " RightNowProductView=""/>
    </ws:GetRightNowProductViewByDivisionResponse>
    i should get all the element attbutes names as attributes in above mentioned format ..using xquery...
    here is the respone ....
    <sage:sageRequestResponse xmlns:sage="http://www.sage.com">
    <env:EaiEnvelope xmlns:env="http://www.sage.com/Envelope">
    <env:Domain>string</env:Domain>
    <env:Service>RightNowBroker</env:Service>
    <env:UserId>string</env:UserId>
    <env:OperationName>GetRightNowProductViewByDivision</env:OperationName>
    <env:Payload>
    <ws:GetRightNowProductViewByDivisionResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.sage.co.uk/">
    <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="RightNowProductView" msdata:UseCurrentLocale="true">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="RightNowProductView">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="ProductId" type="xs:short"/>
    <xs:element name="Product" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="4000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
    <xs:selector xpath=".//RightNowProductView"/>
    <xs:field xpath="ProductId"/>
    </xs:unique>
    </xs:element>
    </xs:schema>
    <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"/>
    </ws:GetRightNowProductViewByDivisionResult>
    </env:Payload>
    </env:EaiEnvelope>
    </sage:sageRequestResponse>

    Hi
    Just as an aside to the comments above, a scenario we see occasionally is where a desk provides an internal function (e.g. a helpdesk) and you really just want to get the name display (as seen on the handsets) onto the CAD display.
    You can do this by  doing a reverse lookup over HTTP against CUCM. There are a number of posts around, these should get you started :
    https://supportforums.cisco.com/thread/2065114
    https://supportforums.cisco.com/message/3024617
    A couple of notes:
    - It looks up against the directory, NOT the actual calling line. So you can add stuff to the directory to get external callers to show up by name, but should expect the unexpected when you have shared lines (e.g. multipel directory entries with one tel number for whatever reason)
    - If you want to do different lookups (i.e. get names back in a different format, get the actual line display name from CUCM, or lookup elsewhere) then you would need to either:
    1) Do it via SOAP or another technology from the UCCX script engine
    2) Put in a small external web service to do the lookups and allow UCCX to query via simple HTTP
    3) Use a DB for the numbers so you can read/write to it from UCCX and regularly update the data from wherever you like
    Regards
    Aaron HarrisonPrincipal Engineer at Logicalis UK
    Please rate helpful posts...

  • Retrieve all attributes with specified name attribute

    hi all,
    how to extract the ancestor attributes with given name which is also an attribute?
    for eg.
    <country>
    <sponsor id="1" level="1" name="john">
    <sponsor id="2" level="2" name="mary">
    <sponsor id="3" level="3" name="ken">
    <sponsor id="4" level="4" name="mick"/>
    </sponsor>
    </sponsor>
    <sponsor id="2" level="2" name="kary"/>
    </sponsor>
    </country>
    (the structure above will be deemed as unlimited nested nodes)
    +how to get ancestor given name=mick, will return one way ancestor sponsor named: ken,mary and john?
    +the attribute name is the key to travese up or down, how to get the value?
    please advise, and thanks
    regards,
    wesley

    i solved one part of my problem.
    But, now i have to get all attributes for each users and i couldn't find them. The getattributes method doesn't return anything (i 'd like to retrieve the first name, last name, adress ...)
    thanx for help

  • How to retrieve attribute-names (not values)

    Hi
    I know that I can get all attributes by an XPath expression according to /AA/@* . But since I have a XML document in XMLType and when I use the "..extract( aXpath)" function, I get all the attributes of the corresponding node but as a concatenation of the values. How can I get the attributes names:
    E.G.
    AA
    BB 12.3 /BB
    CC 45.5 /CC
    /AA
    /AA/@* would return 12.345.5, but I need to know "BB" and "CC", any ideas ?

    ${applicationScope.abc}
    or if there is no attribute "abc" in page, request, or session scopes just
    ${abc}

  • How to find database attribute names that correspond to page labels

    I've been tasked with creating one or more views to be used in creating reports. The users know data items by the labels on pages, not the database attribute names. So my dilemma is how to correlate the page labels to the database attributes.
    For example, there's a course details web page. It includes items labeled "Replacement Course", "Inherited Competency Update Setting" and "Attachments", among others.
    Focusing on "Inherited Competency Update Setting"... there's no database attribute called that. I've found COMPETENCY_UPDATE_LEVEL, but I don't know if that is it. And is an "inherited" one different than a non-inherited.
    I've googled about, and discovered that "Inherited Competency Update Setting" can be set by using a workflow named OTA_COMPETENCE_UPDATE_JSP_PRC and setting an attribute named HR_APPROVAL_REQ_FLAG. Further research has lead me to determine that HR_APPROVAL_REQ_FLAG is used only within the workflow system. I've found in SYS.ALL_SOURCE a package OTA_COMPETENCE_SS with a function that gets that attribute's value. It includes a query against WF_ACTIVITY_ATTR_VALUES which retrieves values of YES_DYNAMIC, APPROVAL, NO, YES or NOTIFYONLY. I've not found any code that uses the function.
    Using ALL_TAB_COLUMNS, I'd found COMPETENCY_UPDATE_LEVEL in OTA_OFFERINGS, which contains "APPROVAL" or null. So that may be what I seek, but I can't confirm it.
    I also have been unable to find the translation from "APPROVAL" to "Notification, Automatic Update after Approval" (assuming I'm correct and this is the field)
    I've found a Training Administration Technical Reference Manual for Release 11i, which contains information about the database, but I've found no corresponding document for Learning Management for 12.1 (Only installation and user guides).
    And this is many days' research to find one attribute. Which I'm not certain I've found.
    So, in this case in particular, or any case in general, how does one find the database name for an attribute, given the page label's text??
    Thank you
    Cornell

    Whoa, easier than I'd thought...
    When the page first shows up, there's the About This Page link, at the bottom, clicking it you get to the About Page.
    I noted two sections, Page Definition and Business Component References Details.
    I expanded Business Component References Details and found View Objects. There's a list of views used. I was dismayed that the views don't appear to be in the database. Of course, they're camelCased Java names of Java objects, not database names (although sometimes some of the camelCased tokens might correspond to parts of view names). They are, however, clickable and when clicked the definition shows up, and I was thinking that it would take a long while to find what I was seeking.
    But... Hit the Expand All link in Page Definition, do a find on page for the desired label, and there it is... a row with the label, view object name and attribute! Pay dirt!
    Then go to the Business Component References Details, find the View Object, click it, and there's the view :-) Find the attribute, then the table... easy peasy!
    Thank y'all again

  • "LPX-00601: Invalid token in:" when retrieving namespaced attribute

    I'm trying to retrieve an attribute value from an XML document as follows:
    declare
       l_url varchar2(500);
       l_xml xmltype;
    begin
       l_xml := xmltype('<WMT_MS_Capabilities version="1.1.1">
                          <Capability>
                             <Layer>
                               <Layer>
                                  <Style>
                                    <Name>default</Name>
                                    <Title>default</Title>
                                    <LegendURL width="233" height="141">
                                       <Format>image/png</Format>
                                       <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
                                                       xlink:type="simple"
                                                       xlink:href="http://very_long_url"/>
                                    </LegendURL>
                                  </Style>
                              </Layer>
                              </Layer>
                              </Capability>
                          </WMT_MS_Capabilities>');
       select extractvalue(l_xml
                          ,'//WMT_MS_Capabilities/Capability/Layer/Layer/Style/LegendURL/OnlineResource@xlink:href'
                          ,'xmlns:xlink="http://www.w3.org/1999/xlink"')
         into l_url
         from dual;
         dbms_output.put_line(l_url);
    end;This code executes fine in a 9.2.0.5 database but on Oracle 10.2.0.4 I get:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '//WMT_MS_Capabilities/Capability/Layer/Layer/Style/LegendURL/OnlineResource@xlink:href'
    ORA-06512: at line 26What am I doing wrong?

    Found the bug. there is a / missing before the @ in the xpath expression. 9R2 does not seem to care about this.
    Correct path=
    '//WMT_MS_Capabilities/Capability/Layer/Layer/Style/LegendURL/OnlineResource/@xlink:href'

  • Workflow Attribute Names

    Answer me this...
    When you create a workflow in the Workflow builder, one is FORCED to have the item level and function level attribute internal names to be all uppercase. Fine. So I make a work attr called MY.ATTR.NAME.
    But then, in a PL/SQL function, I am allowed to call WF_ENGINE.GetItemAttrText(itemtype,itemkey,'MY.attr.NAME') and it will fail. It will fail because there is no such attribute called MY.attr.NAME and that is because the workflow builder creates all attributes with uppercase names.
    Why in the GetItemAttr and GetActivityAttr functions does Oracle not call UPPERCASE on the names? It would only make sense, so that there is a normalized form of attribute naming? Or make the search for attribute names case-insensitive. Looking at the function body, neither is done. Why is that?
    Its forcing me to wrap the Oracle-provided functions with my own that call UPPERCASE on the attr names and then call the Oracle functions because I have many users who will be creating workflows and their corresponding PL/SQL functions and I'd like to make it as painless as possible.

    Raja,
    How does one go about opening an ER? Through my MetaLink account?
    I mean, its not absolutely necessary although I would like to see it in a future patch or version. I just didn't understand the logic behind it... Force users to be able to create only uppercased attribute names but when they go to retrieve them, allow any capitalization. That just leaves room for unnecessary errors.

  • Re: Retrieve operational attributes

    Dear all,
    Do you have any concrete Java program example using standard Java API provided by JDK1.3.1 to retrieve the operational attributes of a entry stored in Sun One Directory Server?
    Thanks!
    Calvin

    There is no "+" pseudo attribute name that will retrieve all operational attributes in an entry, like OpenLDAP has. You must specify all of the operational attributes you want to get back in your search attribute list. If you need to get a list of all possible operational attributes, you have to query the schema - the attribute definition will tell you if the attributeType is operational.

  • BC4J Row Attribute Names

    How do I go about getting the Attribute Names from a selected Row in BC4J?
    I use the row.getAttribute(x) method to retrieve the attribute data, but I also need to know the name of the attribute in the entity (ie EMPID).
    null

    Heh! Steve! Great presentations by you at Open World.. Thanks.
    Thanks for pointing out the 'clean/correct' way of getting the view object's metadata.
    I don't think I would've known about this method of getting the attribute info without your pointing it out explicitly in this thread... if I had tried to wrangle it out of the online docs it would've taken hours, since all I could find is a twisty little maze of interfaces and classes going down to the ninth circle of... well...thanks. grin

  • Retrieving xsd-attributes in Java...

    i want to use attributes in the XSD like
    <element name="ProcessRequest">
    <complexType>
    <attribute name="attribute1" type="string"/>
    </complexType>
    </element>
    i tried
    ((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable", "payload", "/client:ProcessRequest/client:input/element1/@attribute1")).getFirstChild().getNodeValue();
    i am not able to retrieve the value...

    Hi,
    just to clarify:
    i do not have a namespace problem!
    <element name="ProcessRequest2" type="xsd:string">
    <complexType>
    <sequence>
    <element name="attribute1" type="string"/>
    </sequence>
    </complexType>
    </element>
    i am able to retrieve the value with
    ((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable", "payload", "/client:ProcessRequest/client:input/attribute1")).getFirstChild().getNodeValue();

  • JAZN-LDAP : retrieve inetOrgPerson attributes from principal object

    Hello.
    I 've extended callerInfo demo (in OC4J distrib :j2ee/home/jazn/demo) :
    1. use of JAZN-LDAP
    2. now the servlet prints the "HttpServletRequest.getUserPrincipal()" object attributes (class implementation : oracle.security.jazn.oc4j.JAZNUserAdaptor) : the servlet prints LDAP attributes like user DN, subscriber name, groups member, ....
    Is it possible to retrieve other attributes of the LDAP object user (like description, businessCategory) by the java.security.Principal interface ?
    Thanks.

    Try this
    public String getCompanyByUserDN(String userDN) throws Exception
    String result = null;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://<<LDAP HOST>>:<<LDAP PORT>>");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, <<User DN>>);
    env.put(Context.SECURITY_CREDENTIALS, <<User Password>>);
    DirContext dirCtx = new InitialDirContext(env);
    DirContext userCtx = (DirContext)dirCtx.lookup(userDN);
    Attributes attrs = userCtx.getAttributes("", new String[] {"o"});
    result = (String)attrs.get("o").get();
    return result;
    }

  • Uix get Oracle DB attribute name

    I have a uix sort event calling a java method. In the java method, I can get the view object attribute name for the column to be sorted from the page event.
    I need to obtain the Oracle database attribute name associated with the view object attribute name so I can construct an ORDER BY clause for the sort.
    Does anyone know how to do this?
    Right now I am trying to get my java program to retrieve the Oracle DB name.
    If this is not easy to do in java, is there a way in the uix code I could set a page property for the column selected to be sorted, with the Oracle DB attribute name in it? The idea would be to set the page property with the proper value when someone clicked on the column header to cause the sort to happen.
    I really appreciate any help you can give.
    Best regards,
    Steve

    This topic is closed. I solved the problem another way.

  • How To Get Attribute Names for a Particular VO

    Hi ,
    How To Get Attribute Names Of a Vo where I can Set Viewattributname To the Table RN Columns Where I am Adding Extra Columns Based on Some Condn..
    So wen i am creating new Column to existing Table RN and we Need to add Attribute Name Also...Rt..
    And How To get RelationShip Between Database Column Name and Java Vo Attribute Name
    Ex: PlanId is the Java VO Attribute Name for the Database Column PLAN_ID
    In The Same way Hw We Get the Relation ship for All other columns In the Controller Cllass ..
    Can Any One Reply as It is urgent Req...
    Thanks ,,
    Jithen

    Instead of using the VO attribute names to set and get values, best to go to the VO definition, click on Java, and generate the View Row Class with the accessors.
    In the class where you're trying to set attributes, instead of a Row class, use the View Row class of your VO (eg ViewObjectName's class would be ViewObjectNameRowImpl), and when retrieving a row from the VO, cast the row to the previously mentioned View Row Class.
    At that point you can use the View Row Class's methods that would perform sets and gets of each column.
    To get attribute names, I don't know off the top of my head, but there might be a method mentioned in the Javadoc for the ViewRowImpl or ViewObject or ViewObjectDefinition classes to get the attribute/column mapping, or perhaps you can somehow read the XML definition of the VO which has that mapping.
    Assuming business components were built automatically and no attribute names were overridden, intuitively the attribute name is a camelcase version of the column name, removing understores and capitalizing the character following the removed underscore - but that's not a fool proof approach. Just a general observation.
    Hope this helps.
    Edited by: user6631964 on Sep 16, 2010 12:31 PM

  • Retrieving portal user name

    Hi,all
    In NW 2004 I retrieved the user name of portal user by following:
    HttpServletRequest req =((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter ()).getHttpServletRequest();   
    wdContext.currentContextElement().setUserName(req.getRemoteUser());
    But in NW 2004S it is not working.I can not to locate IWebContextAdapter.
    How can I retrieve the portal user name here?
    Regards,
    Michael

    Hi,
    Please try following code and let me know.
    import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    try
         //get the currently logged in user
         IWDClientUser wdUser = WDClientUser.getCurrentUser();
        //get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user
        IUser user = wdUser.getSAPUser();
       //check whether the user is anonymous
       if (user != null)
          //access logon ID by iterating through the IUserAccount array
          IUserAccount[] acct = user.getUserAccounts();
         if(acct[0] != null)
            String strUserid = acct[0].getLogonUid();
            wdContext.currentContextElement().setId(strUserid);
            //pass the value obtained from the portal to value attribute
    catch (Exception e)
       wdComponentAPI.getMessageManager().reportException("Failed to get current user: " + e.getLocalizedMessage(), true);
    Regards,
    Vaibhav

Maybe you are looking for

  • How do I re install Adobe Photoshop Elements 9 ?

    I lost Adobe Photoshop Elements 9 , when I apparently accepted an update for this product ?   How do I get it back ?  How can I reinstall ?  I have the originall installation disk, but all it does is spin and spin - it's probably a one time thing, ri

  • TS3992 Last backup could not be completed

    I am not able to back up my iPhone. The message says, "The last backup could not be completed." That is it. I've restarted my phone. The storage area says, "iCloud storage details are currently unavailable. Try again later."

  • I can't insert hyperlink to email me button,can you help me.

    When I try to insert hyperlink to email me button it won't bold up so i can click on it. How do i add the email address I want the button to link to?

  • Resume on wrong monitor

    Can anyone tell me why my iMac (mid-2010, 21.5, 500GB disk, 4GB RAM, radeon 4670 video), running Arch (xfce), always starts on the main monitor (with external monitor connected, but not switched on) but then sleeps, and resumes only on my external mo

  • HT204382 How can i play .avi movies on my MAC

    I need to know how i can watch .avi extension on my MAC. What free software is needed to be downloaded