Get unique values from an xml table

I have an xml file and I would like to create a table of all the unique values of one of its nodes.

The xml file is called pntxml and the node is pntxml.row.Category where the category is where I would like to create a table of all the unique values.

I was working through this and would first create an array of all the values in the category in iterating through the xml and pushing these values in a separate table.  When I try to push each entry in a table I get an error or

TypeError: Error #1009: cannot access a property or method of a null object reference.
at NAPA_fla::MainTimeline/sortXml()

var catArray:Array;

function sortXml(event:Event):void{
for (var i:int = 0; i< pntxml.row.length(); i++){
     tmpCat=pntxml.row[i].Category;
     trace(tmpCat);
        catArray.push(tmpCat);           
}
}

Anyone has a suggestion for the best way to get at this problem?

Thanks in advance,

Josh

Your catArray does not exist because you said only she, you have not created an instance of this...

var catArray:Array = new Array();

Tags: Adobe Animate

Similar Questions

  • getting a value from an XML string

    If I want a loader to load a text file based on XML how I'd get the XML to return a string.


    The first lines of code are my xml file.
    The following code excerpt is my charger of xml.
    The last code snippet is where I want my text file to load.
    In my line of code which is: myLoadVar.load (t.content); How can I get the value of t.content I got an xml file for a file name? I think I should do my xml file returns a string.

    You must add a line of code. I need to see the where it is located, in the lines below.

  • How to get the value of an xml element attributes

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0

    I'm trying to parse an XML document

    < response >
    < well uwi = "102112900816W400" > < / well >
    < production >
    < PRODUCING_ENTITY >
    < NUMBER YEAR = '2009' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2010' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2011' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2012' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < / PRODUCING_ENTITY >
    < / production >
    < / well >
    < well uwi = "100092900816U400" > < / well >
    < production >
    < PRODUCING_ENTITY >
    < NUMBER YEAR = "1999" >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2000' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2001' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = "2003" >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < / PRODUCING_ENTITY >
    < / production >
    < / well >
    < / answer >

    For the purposes of the practice, I have saved this in my table tdw_test_xml_files;

    My goal is to get the /WELL/@uwi and /YEAR/@NUMBER

    UWI YEAR
    ------ ---------------
    102112900816W400 2009
    102112900816W400 2010
    102112900816W400 2011
    102112900816W400 2012
    100092900816U400 1999
    100092900816U400 2000
    100092900816U400 2001
    100092900816U400 2003


    I tried this... but I can't get the value of the attribute for the element < YEAR >

    Select r.uwi, r.year
    of tdw_test_xml_files.
    XMLTABLE
    (
    "for $WELL in $ response/WELL/good.
    for $DEPT to $UWIIDX in $WELL, Production, PRODUCING_ENTITY, YEAR
    return < RESULT >
    University of the West Indies West <>{fn:data($WELL/@uwi)} < / UWI >}
    {
    $WELL/production/PRODUCING_ENTITY/YEAR [$UWIIDX]-> (I don't know how to extract the value of the attribute here)
    }
    < / RESULT > '
    passing FILECONTENT as 'GOOD '.
    columns
    UWI VARCHAR (50),
    YEAR vARCHAR2 (24)
    ) r
    /


    If I do this; I get the Cartesian plan result set, which is not my goal

    SELECT xtab.*, xtab2.*
    OF tdw_test_xml_files, XMLTable (' for $i in/Response/Well)
    Return $i"
    PASSAGE filecontent
    Uwi varchar2 COLUMNS (50) PATH'@uwi'
    rn for ORDINALITE
    ) xtab
    , XMLTable (' for $i in/Response/Well/Production/PRODUCING_ENTITY/YEAR)
    Return $i"
    PASSAGE filecontent
    COLUMNS year varchar2 (50) PATH'@NUMBER'
    ) xtab2;

    Any help will be highly appreciated thanks...

    I'm just curious to know how make the query now in unique XMLTable, not that I am forced by using x number of xmltable; - P, just look more clean...

    Here goes:

    SQL> SELECT x.*
      2  FROM tdw_test_xml_files t
      3     , XMLTable(
      4         'for $i in /Response/Well
      5            , $j in $i/Production/PRODUCING_ENTITY/YEAR
      6            , $k in $j/MONTH
      7          return element r {
      8            $i/@uwi
      9          , element year  {data($j/@NUMBER)}
     10          , element month {data($k/@NUMBER)}
     11          }'
     12         passing t.filecontent
     13         columns uwi   varchar2(50) path '@uwi'
     14               , yr    varchar2(4)  path 'year'
     15               , mon   varchar2(2)  path 'month'
     16       ) x
     17  ;
    
    UWI                            YR   MON
    ------------------------------ ---- ---
    102112900816W400               2009 1
    102112900816W400               2009 2
    102112900816W400               2009 3
    102112900816W400               2010 1
    102112900816W400               2010 2
    102112900816W400               2010 3
    102112900816W400               2011 1
    102112900816W400               2011 2
    102112900816W400               2011 3
    102112900816W400               2012 1
    102112900816W400               2012 2
    102112900816W400               2012 3
    100092900816U400               1999 1
    100092900816U400               1999 2
    100092900816U400               1999 3
    100092900816U400               2000 1
    100092900816U400               2000 2
    100092900816U400               2000 3
    100092900816U400               2001 1
    100092900816U400               2001 2
    100092900816U400               2001 3
    100092900816U400               2003 1
    100092900816U400               2003 2
    100092900816U400               2003 3
    
    24 rows selected
     
    
  • Getting a value from selectonechoice

    Hello

    I use Jdeveloper 11.1.1.6

    My requirement is as below

    I have a component selected only one option, which displays a list of values.

    The user selects a value from the list of value and clicks the command button, and then the input field should be updated with the

    the value that is selected in the list.

    To do this, I wrote the code (no components company involved / only ADF faces) below

    I am able to get the list of values and post it on my page. For the rest of the game, I am not able to guess.

    I put selectoncechoice partialtriggers for buttons and the text in field

    All I need is the java code for getting the selected value and by attaching it to the text field.

    Can you help or guide me on this...

    Bean:

    The list < SelectItem > tempList.

    {} public void settempList (list < SelectItem > tempList)

    this.tempList = tempList;

    }

    public list < SelectItem > gettempList() {}

    If (tempList == null) {}

    tempList = new ArrayList < SelectItem > ();

    tempList.add (new SelectItem ("t1", "Item 1"));

    tempList.add (new SelectItem ("t2", "Item 2"));

    }

    Return tempList.

    }

    USER INTERFACE:

    <? XML version = "1.0" encoding = "UTF - 8"? >

    " < = xmlns:jsp jsp:root ' http://Java.Sun.com/JSP/page "version ="2.1"xmlns:f =" " http://Java.Sun.com/JSF/core "

    ' xmlns:af = ' http://xmlns.Oracle.com/ADF/faces/rich "> "

    < jsp:directive.page contentType = text/html"; Charset = UTF - 8 "/ >

    < f: view >

    < af:document title = "listPage.jspx" id = "d1" > "

    < af:form id = "f1" >

    < af:panelGroupLayout id = "pgl1" layout = "vertical" halign = "center" >

    < af:spacer width = "10" height = "10" id = "s1" / >

    < af:selectOneChoice label = "Custom List" id = "soc1" contentStyle = "make weight:" BOLD "; color: Green; ">

    < f: selectItems value = "#{Valuesbean.tempList}" id = "si1" / > "

    < / af:selectOneChoice >

    < af:outputText value = "Output text" id = "ot1' partialTriggers ="soc1"/ >

    < af:commandButton text = "Change" id = "ot1' partialTriggers ="soc1"/ >

    < / af:panelGroupLayout >

    < / af:form >

    < / af:document >

    < / f: view >

    < / jsp:root >

    Hello

    If you see:

    You must set a value for the selectOneChoice component. You add a new variable in your beans to use it to store your selectedItem. Then your output text should also reference the same attribute in its value field.

    Try to add in your bean:

    String mySelection;

    public String getMySelection() {}

    return mySelection;

    }

    {} public void setMySelection (String, string)

    mySelection = string;

    }

    value = "#{ValuesBean.mySelection}" label = "Custom List" id = "soc1" contentStyle = "make weight:"BOLD"; color: Green; » >

    and value = "#{ValuesBean.mySelection}" id = "ot1' partialTriggers ="soc1"/ >"

  • How to get the value of row current table when press the button submit

    Hello

    I want to get the current value of the SuccessionPlanId line which is part of the column in a table that is advanced.

    I created a (created using customization, from action through CO) button in the table as column, so each line with a single key, if I press the button of the first line means so I want to extract the first line SuccessionPlanId and if it's the 3rd way so I want to get the value of the value of the third row.

    How in the post of controller?

    Please answer soon, its urgency.

    Thanks in advance,
    SAN

    OK, need to go with a delicate way,

    1.) create a new table with Jdeveloper and there shud be a replica of the room once except the button submit newly added, pls note button type shud be present the type of button.

    2.) hide the existing table area and create a new stacklayoutbean.

    (3.) this stacklayout bean will have the property to extend, you give the full path of the new custom of advanced table box.

    Now you should be able to get the reference of the line during the click on the "submit" button

  • How can I get a value from a function from pl/sql by OADBTransaction

    Hi all
    Hope you will be fine.
    as we know, we can get a sequence by this code value:
    Super.Create (AttributeList);
    Transaction OADBTransaction = getOADBTransaction();

    Vendor ID is obtained from the table sequence
    Number supplierId = transaction.getSequenceValue ("FWK_TBX_SUPPLIERS_S");

    My question is how can I get a value in a variable to a pl/sql function:
    the function is defined as follows:
    ******
    create or replace function getNextTrans return varchar2
    is
    Team varchar2 (20);
    Start
    SELECT "CASH". TO_CHAR (SYSDATE, 'DDMMYYYY') | GP_CASH_TRX_SEQ. NEXTVAL FROM DUAL;
    return team;
    end;
    /

    Hey Dina,

    Reference http://www.oraclearea51.com/oracle-technical-articles/oa-framework/229-calling-database-procedures-and-function-from-oaf.html

    Kind regards
    GYAN

  • Select values from the db1 table and insert into the DB2 table

    Hello

    I have three databases oracle running in three different machines. their ip address is different. among the DB can access databases. (means am able to select values and insert values into tables individually.)

    I need to extract data from the DB1 table (ip say DB1 is 10.10.10.10 and the user is DB1user and the table is DB1user_table) and insert the values into DB2 table (say ip DB2 is 11.11.11.11 and the user is DB2user and table DB2user_table) of DB3 that is to have access to the two IPs DB.

    How do I do this

    Edited by: Aemunathan on February 10, 2010 23:12

    Depending on the amount of data must be moved between DB1 and DB2, and the frequency at which this should happen, you might consider the SQL * COPY more control. I think it's very useful for one-off tasks little, so I can live within its limits of the data type. More http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/apb.htm#i641251.

    Change some parameter of sqlplus session are almost mandatory in order to get decent transfer rates. Tuning ARRAYSIZE and COPYCOMMIT can make a huge difference in flow. LONG change may be necessary, too, depending on your data. The documentation offers these notes on use:

    To activate the copy of data between Oracle and databases non-Oracle, NUMBER of columns is replaced by DECIMAL columns in the destination table. Therefore, if you are copying between Oracle databases, a NUMBER column with no precision will become a DECIMAL column (38). When copying between Oracle databases, you must use SQL commands (CREATE TABLE AS and INSERTION), or you must make sure that your columns have a specified precision.

    SQL * the VALUE LONGER variable limits the length of the LONG column you are copying. If all LONG columns contain data exceeds the value of LONG, COPY truncates the data.

    SQL * Plus performs a validation at the end of each successful COPY. If you set the SQL * variable more COPYCOMMIT DEFINED to a value positive n, SQL * Plus performs a validation after copying all lots n of records. The SQL * Plus ARRAYSIZE variable SET determines the size of a batch.

    Some operating environments require that the service names be placed between double quotes.

    From a SQL * Plus term on DB3, can resemble the command to move all content from my_table in DB1 to the same table in DB2

    COPY from user1/pass1@DB1 to user2/pass2@DB2 -
    INSERT INTO my_table -
    USING select * from my_table
    

    Note the SQL code * more line-continuation character ' - '. It is used to escape the newline character in a SQL * Plus command if you do not have to type all on one line. I use it all the time with this command, but I can't locate the documentation on that right now. Maybe someone else can put their finger on it.

    There are other ways to accomplish what the command copy and it is not without its quirks and limitations, but I find that there is usefulness in an Oracle Toolbox.

  • Difficult to extract multiple values from an XML document

    I have the following XML Document
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Header>
          <ActivityId CorrelationId="4fc67c0d-4416-4c1f-92c5-0d6624fb41fd" 
    xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">30ccb32d-d6f5-4442-a41a-1eb735112501</ActivityId>
       </s:Header>
       <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <FacilitySiteInteractionList xmlns="urn:WA.Ecy.ADS.FacilitySite.Services">
             <FacilitySiteInteraction>
                <Id>78105</Id>
                <StartDate>2009-07-31T00:00:00</StartDate>
                <StatusCode>65</StatusCode>
                <InteractionTypeCode>WQGSWI</InteractionTypeCode>
                <FacilitySiteId>14951</FacilitySiteId>
                <CurrentSystemProgramName>WATQUAL</CurrentSystemProgramName>
                <CurrentSystemName>WPLCS</CurrentSystemName>
                <FederalProgramId/>
                <EndDate xsi:nil="true"/>
                <InteractionId>78105</InteractionId>
                <ProgramFacilitySiteName>Hedwall Inc.</ProgramFacilitySiteName>
                <ModifiedDate>2009-07-31T07:30:57.99</ModifiedDate>
                <ModifiedByName>taus461</ModifiedByName>
                <CreatedDate>2009-07-31T07:30:57.99</CreatedDate>
                <FS_FEATUREs/>
             </FacilitySiteInteraction>
             <FacilitySiteInteraction>
                <Id>78104</Id>
                <StartDate>2009-07-01T00:00:00</StartDate>
                <StatusCode>65</StatusCode>
                <InteractionTypeCode>WQMJIND</InteractionTypeCode>
                <FacilitySiteId>14951</FacilitySiteId>
                <CurrentSystemProgramName>WATQUAL</CurrentSystemProgramName>
                <CurrentSystemName>WPLCS</CurrentSystemName>
                <FederalProgramId/>
                <EndDate xsi:nil="true"/>
                <InteractionId>78104</InteractionId>
                <ProgramFacilitySiteName>Hedwall Inc.</ProgramFacilitySiteName>
                <ModifiedDate>2009-07-31T07:24:02.76</ModifiedDate>
                <ModifiedByName>taus461</ModifiedByName>
                <CreatedDate>2009-07-31T07:24:02.76</CreatedDate>
                <FS_FEATUREs/>
             </FacilitySiteInteraction>
          </FacilitySiteInteractionList>
          <TotalRowCount xmlns="urn:WA.Ecy.ADS.FacilitySite.Services">2</TotalRowCount>
       </s:Body>
    </s:Envelope>
    I need to retrieve the Id of the node FacilitySiteInteraction - in this case, the values are 78104 and 78105.

    I tried to use extractvalue just, but he hesitates with error ORA-19025.
    select extractvalue(x,'//FacilitySiteInteractionList/FacilitySiteInteraction/Id','xmlns="urn:WA.Ecy.ADS.FacilitySite.Services"')
    from my_tab;
    
    ERROR at line 2:
    ORA-19025: EXTRACTVALUE returns value of only one node
    
    -- note: column my_tab.x is an xmltype data type
    If I use just extracted I see there the rub
    select extract(x,'//FacilitySiteInteractionList/FacilitySiteInteraction/Id',
    'xmlns="urn:WA.Ecy.ADS.FacilitySite.Services"')
    from my_tab;
    
    <Id xmlns="urn:WA.Ecy.ADS.FacilitySite.Services">78105</Id><Id xmlns="urn:WA.Ecy.ADS.FacilitySite.Services">78104</Id>
    The format of the XML document does not have to consider another records/lines.

    So, the next thing I tried was using the value of the iterator:
    select extractvalue(x,'//FacilitySiteInteractionList/FacilitySiteInteraction[2]/Id',
    'xmlns="urn:WA.Ecy.ADS.FacilitySite.Services"')
    from my_tab;
    
    78104
    The downside of what I see is that I must first enter the TotalRowCount value and then more wrap XML Document TotalRowCount times
    in order to get these values. So I was wondering if it is a more effective approach to enter these data?

    Thank you, Tony
    SQL>  with t as (
    select xmltype('
    
       
          30ccb32d-d6f5-4442-a41a-1eb735112501
       
       
          
             
                78105
                2009-07-31T00:00:00
                65
                WQGSWI
                14951
                WATQUAL
                WPLCS
                
                
                78105
                Hedwall Inc.
                2009-07-31T07:30:57.99
                taus461
                2009-07-31T07:30:57.99
                
             
             
                78104
                2009-07-01T00:00:00
                65
                WQMJIND
                14951
                WATQUAL
                WPLCS
                
                
                78104
                Hedwall Inc.
                2009-07-31T07:24:02.76
                taus461
                2009-07-31T07:24:02.76
                
             
          
          2
       
    ') xml from dual
    )
    --
    select x.* from t t, xmltable('declare namespace e="urn:WA.Ecy.ADS.FacilitySite.Services";
                                 //e:Id' passing t.xml.extract('//FacilitySiteInteraction','xmlns="urn:WA.Ecy.ADS.FacilitySite.Services"')
                                 columns Id int path '.') x
    /
            ID
    ----------
         78105
         78104
    
    2 rows selected.
    
  • Need to get Max Value day in a table with hourly data of SQL

    I have a table "tmp" with these columns:

    ID, date, time, value

    I want to get the 'time' when 'value' max is reached in each 'day '.

    the query:

    "SELECT id, day, hour, max (value) from group tmp by id, date, time"
    does not return the desired lines.

    You have an idea to get what I want?

    Maybe this:

    with tmp as
    ( select 1 id, trunc(sysdate) day, 10 hour, 100 value from dual union all
      select 2 id, trunc(sysdate) day, 11 hour, 110 value from dual union all
      select 3 id, trunc(sysdate) day, 12 hour, 120 value from dual union all
      select 4 id, trunc(sysdate) day, 13 hour, 130 value from dual union all
      select 5 id, trunc(sysdate-1) day, 10 hour, 100 value from dual union all
      select 6 id, trunc(sysdate-1) day, 11 hour, 90 value from dual union all
      select 7 id, trunc(sysdate-1) day, 12 hour, 150 value from dual union all
      select 8 id, trunc(sysdate-1) day, 13 hour, 100 value from dual )
    Select ID, Day, Hour, Value
    From Tmp
    Where (Day, Value) IN (
    Select Day, Max(Value)
    From Tmp
    Group by Day)
    

    Results:

            ID DAY             HOUR      VALUE
    ---------- --------- ---------- ----------
             7 08-DEC-08         12        150
             4 09-DEC-08         13        130
    
    2 rows selected.
    

    Kind regards
    Miguel

  • To get the value from the user input

    Hi guys,.

    I have a .sql file, I need to get the feedback from the user and date to treat more end passing as a parameter in the procedure

    test. SQL

    Proc_process (p_in = > lv_in p1_in = > lv_in1);

    Once the process described above is then ask the user to change the table with the name of columnn like col_1

    Press on Y to continue or N to exit

    ALTER table T1 add col_1 date;

    I want these operations to be performed when run test.sql

    Hello

    Maybe something like that

    accept option_1 char prompt 'Do you want to alter table T1 ? ( press y to continue n to skip ) : ' default n
    accept option_2 char prompt 'Do you want to alter table T2 ? ( press y to continue n to skip ) : ' default n
    
    prompt alter table T1 : &option_1
    prompt alter table T2 : &option_2
    
    BEGIN
      --
      IF upper('&option_1') = 'Y'
      THEN
          DBMS_OUTPUT.PUT_LINE('>>>>>>>>>>> ALTER TABLE T1');
      END IF;
      --
      IF upper('&option_2') = 'Y'
      THEN
          DBMS_OUTPUT.PUT_LINE('>>>>>>>>>>> ALTER TABLE T2');
      END IF;
    END;
    /
    
    undef option_1
    undef option_2
    
    prompt @d:\temp\test_accept_2.sql
    

    concerning

    Kay

  • Getting a value from a text of entry in backing bean element

    I created a component of entering text on a page where I will enter a number, adjustment of Autosubmit as true. ValueChangeListener property is defined as #{test.displayTable} where displayTable is a method defined in managed bean test.

    Now I know to extract the value entered in the text input component by creating a RichInputText variable in the advanced properties.

    But in case the Advanced property is empty, then how I'll be able to recover the value of it? This is the code. I'm not able to get the value entered in the component. I can not even find any method getvalue for her.
    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIViewRoot root = facesContext.getViewRoot();
    RichInputText inputText = (RichInputText) root.findComponent("it1");  // it1 is the id of the input text component
    System.out.println("inputText: "+inputText);
    On the use of my statement, is out getting generated, whereas I had entered in 90.
    inputText: RichInputText[UIXEditableFacesBeanImpl, id=it1]

    Hello

    Always mention your JDev version.

    If you use a valueChangeListener for the field, you can get the value using valueChagedEvent.getNewValue ().

    Arun-

  • I can't get a value from a list of CFDIRECTORY.

    I avoided the madness all these years, but this issue was finally on the brink.  My placement in an institution is in your hands.

    I try to get the name of a specific directory to the list of directories produced by action CFDIRECTORY = 'list '.  But everything I try fails in one way or another.  Bascially, I can't get the value of the structure - even if the code IS the value - because he thinks that the value is meant to be a field or a key.  (The server running CF8).

    These lines of code work fine:

    <!-do and loop through the list of local directories. ->

    < CFSET LocalDirectoryList = "" > "".

    < action CFDIRECTORY = 'list' name = "LocalDirectoryList" TYPE = "dir" directory = "#PathOfLocalFolderToCopyToRemoteFolders #" >

    < CFIF IsDefined("LocalDirectoryList.RecordCount") AND GT LocalDirectoryList.RecordCount '0' >

    < request CFLOOP = "LocalDirectoryList" >

    Now comes the killer.  I want to set a variable whose value is the name of the local current directory - in other words, the value of LocalDirectoryList.Name for each loop the loop.  But if I try to access LocalDirectoryList.Name as a string variable simple, the way I usually for a query string variable-

    < CFSET ThisLocalDirectory = LocalDirectoryList.Name >

    -I get a message "you have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.

    However, if I treat the "LocalDirectoryList.Name" as a structure and try to deconstruct with one of the following conditions.

    (1) < CFSET ThisLocalDirectory = Evaluate (LocalDirectoryList.Name) >

    (2) < CFSET ThisLocalDirectory = ' #Evaluate (LocalDirectoryList.Name) # ">

    (3) < CFSET ThisLocalDirectory = ' #StructFind (LocalDirectoryList, Name) # ">

    (4) < CFSET ThisLocalDirectory = StructFind (LocalDirectoryList, name) >

    (5) < CFSET ThisLocalDirectory = ' #Evaluate (StructFind (LocalDirectoryList, name)) #">".

    I get either "horizons variable is not defined" (for 1 or 2) or "the specified key, backgrounds, does not exist in the structure" (for 3, 4 or 5).

    In this case, the name of this directory is "horizons."  If the value I'm looking for do EXIST in the structure of 'LocalDirectoryList '.  And the code IS that IT is.  But he thinks it is the NAME of a key, rather than the VALUE of the key.

    Note: The addition of the attribute, listInfo = "Name" to the CFDIRECTORY tag limit fields returned, or key, "Name", but LocalDirectoryList.Name is still a structure, and I still get the same results.

    I'll be the next cuckoo in the cuckoo's nest?  Or can you save me and keep me sane?  My fate is in your hands.

    Thank you!

    You don't need the evaluate statement (in fact you probably shouldn't need to use than ever at that time). And inside the loop of your application, you can send all your query without prefix fields.

    When in doubt, empty your query of cfdirectory.

  • Get more value from my table records

    Hi Experts,
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    
    SQL> WITH T AS
      2  (
      3  SELECT  1 ID,'1OIKL' VAL,1 FLAG FROM DUAL UNION ALL
      4  SELECT 2,'9IUY',0 FROM DUAL UNION ALL
      5  SELECT 3,'9IUK',0 FROM DUAL UNION ALL
      6  SELECT 4,'9IUS',0 FROM DUAL UNION ALL
      7  SELECT 1,'1OIKL',0 FLAG FROM DUAL
      8  )SELECT * FROM T;
    
            ID VAL         FLAG
    ---------- ----- ----------
             1 1OIKL          1
             2 9IUY           0
             3 9IUK           0
             4 9IUS           0
             1 1OIKL          0
    
    SQL>
    I need the unique output like VAL result with the biggest FLAG
            ID VAL         FLAG
    ---------- ----- ----------
             1 1OIKL          1
             2 9IUY           0
             3 9IUK           0
             4 9IUS           0
    SQL>
    Thank you

    Published by: DB-user11904889, March 24, 2010 15:51
    Code field included in the values of the table

    Try:

    SQL> create table T AS
      2  SELECT 1 PK, 1 ID,'1OIKL' VAL,1 FLAG FROM DUAL UNION ALL
      3  SELECT 2,2,'9IUY',0 FROM DUAL UNION ALL
      4  SELECT 3,3,'9IUK',0 FROM DUAL UNION ALL
      5  SELECT 4,4,'9IUS',0 FROM DUAL UNION ALL
      6  SELECT 5,1,'1OIKL',0 FLAG FROM DUAL;
    
    Table created.
    
    SQL> select * from t;
    
            PK         ID VAL         FLAG
    ---------- ---------- ----- ----------
             1          1 1OIKL          1
             2          2 9IUY           0
             3          3 9IUK           0
             4          4 9IUS           0
             5          1 1OIKL          0
    
    5 rows selected.
    
    SQL> delete from t t1
      2  where exists ( select null
      3                 from   t t2
      4                 where  t1.val = t2.val
      5                 and    t1.flag < t2.flag
      6               );
    
    1 row deleted.
    
    SQL> select * from t;
    
            PK         ID VAL         FLAG
    ---------- ---------- ----- ----------
             1          1 1OIKL          1
             2          2 9IUY           0
             3          3 9IUK           0
             4          4 9IUS           0
    
    4 rows selected.
    
  • How to get the value of an af:Table SelectOneChoice

    V11.1.2.4.0 - JSF JDeveloper

    Greetings,

    Im having a problem getting a column value that is an object of a select choice.

    This isn't a common problem, as I actually did something that others so please follow my problem

    Description and if you have questions/answers please answer below.

    I create a database view that returns me 3 columns, say TestValue TestCode, TestDescription.

    I added an extra temporally column in my OV and called Temp.

    I drag / drop my OV, remove value Temp and its position of the column, I drag / drop a LOV, who comes from a different view.

    that shows me the doctor name & first name and identification number of the back doctor select a value of choice.

    I'm using a function that go through the iterator, gets the lines and save them in the database (no matter how).

    The problem is my selectonechoice, are not row.bindings.DoctorId.InputValue, but the links. DoctorId.InputValue instead, so I can retrieve value selectonechoice of the current line.

    Then when my loop is finished and insert rows in my database, id of the doctor of the line everyone is the same as the binding do not change through the loop.

    I don't know how to add value to the current line select only one option to use the correct value to each loop of the line.

    Here is my loop function:

            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iterator = bc.findIteratorBinding("ExaminationsIterator");
            DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    
    
             RowSetIterator rsi = iterator.getRowSetIterator();  
             int i=0;
             
            OperationBinding save_exams = bindings.getOperationBinding("SAVE_EXAMINATION");
            OperationBinding save_exams_commit = bindings.getOperationBinding("SAVE_EXAMINATION_COMMIT");
               
            try{
             while(i < rsi.getRowCount()){
                 
                 Row r = iterator.getCurrentRow();
                                 
                 save_exams.getParamsMap().put("CodeTest", r.getAttribute("CodeTest"));
                 save_exams.getParamsMap().put("Dates", r.getAttribute("Dates"));   
                 save_exams.getParamsMap().put("CodeId", orderid.getValue());   
                 save_exams.getParamsMap().put("Times", r.getAttribute("Times"));    
                 save_exams.getParamsMap().put("DoctorId", resolveExpression("#{bindings.DoctorId.attributeValue}").toString()); 
                 save_exams.getParamsMap().put("IdPatients", patientid.getValue());   
                 save_exams.execute();
                 rsi.next();
                 i++;
             }
            
                save_exams_commit.execute();
    

    I get the connection id of the current doctor and the value of the rows no.

    Can you help me on this please?

    I created a work around solution, until an expert that I come with a more advanced solution.

    (1) I add a LOV at the id of the doctor on the view target object.

    (2) on the duration, I fill my view of database

    3) go through all my DB view iterator lines

    (4) appends each line on the View object target (missing id of the doctor, because I want it to be on common language runtime) & commit lines

    (5) after the loop ends and the target object from view show me results from the view of DB, I choose the runtime id of the doctor and commit the changes if

    the new lines, with the new update will be finally filled to the database.

    I hope this helps if anyone has a similar task.

    Please let me know if you find a more direct solution, this work with 2 tables to fill 1.

  • Get a value from a row in a column

    I have a table contains the following data


    IDStudentclassclasseRoom
    1English3-B3-B
    2nullnull3-B
    3nullnull3-B
    4JackOuMe3-B
    5RichardDSA3-B
    6JhonRoss3-B
    7French3-B3-B
    8nullnull3-B
    9nullnull3-B
    10JackOuMe3-B
    11RichardDSA3-B
    12JhonRoss3-B
    13Spanish5-B5-B
    14nullnull5-B
    15nullnull5-B
    16CenaADI5-B
    17MikeRock5-B
    18PhilippeDSK5-B


    I need a select query to get the result as below:


    IDStudentclassclasseRoomCLASSES
    1English3-B3-BEnglish
    2nullnull3-BEnglish
    3nullnull3-BEnglish
    4JackOuMe3-BEnglish
    5RichardDSA3-B
    English
    6JhonRoss3-BEnglish
    7French3-B3-BFrench
    8nullnull3-BFrench
    9nullnull3-BFrench
    10JackOuMe3-BFrench
    11RichardDSA3-BFrench
    12JhonRoss3-BFrench
    13Spanish5-B5-BSpanish
    14nullnull5-BSpanish
    15nullnull5-BSpanish
    16CenaADI5-BSpanish
    17MikeRock5-BSpanish
    18PhilippeDSK5-BSpanish


    I tried something like this:

    Select ID, STUDENT, CLASS, FIRST_VALUE (STUDENT) IGNORE NULLS above (SCORE FROM CLASSEROOM ORDER BY ID) CLASSES from my_table


    but I don't have the answer


    Thanks for help

    How about this slight adjustment to the solution of Solomon?

    select id,
      student,
      class,
      classeroom,
      last_value(
        case when class = classeRoom then student end
      )
      ignore nulls
      over(order by id) classes
    from  t
    order by id;
    
    ID STUDENT CLASS CLASSEROOM CLASSES
    1 English 3-B 3-B English
    2 null null 3-B English
    3 null null 3-B English
    4 Jack OuMe 3-B English
    5 Richard DSA 3-B English
    6 Jhon Ross 3-B English
    7 French 3-B 3-B French
    8 null null 3-B French
    9 null null 3-B French
    10 Jack OuMe 3-B French
    11 Richard DSA 3-B French
    12 Jhon Ross 3-B French
    13 Spanish 5-B 5-B Spanish
    14 null null 5-B Spanish
    15 null null 5-B Spanish
    16 Cena ADI 5-B Spanish
    17 Mike Rock 5-B Spanish
    18 Philippe DSK 5-B Spanish

Maybe you are looking for