Add a for each script to loop through HTTPService?

I'm using Flash Builder 4 with the Flex 4.1 SDK.  I want to add a "for each" script to loop through my HTTPService XML file so only each nepName displays only once in my dropdown list.  In my XML file I have multiple records associated with nepName.  I would like ALL the records associated with each nepName to populate in my datagrid when it is selected from the dropdown.  Currently in my dropdown there is a nepName entry for each XML tag.  I hope I was able to explain that well enough. I'll try to put my code below so you can see everything I'm working with.
MXML:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:esri="http://www.esri.com/2008/ags"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
               creationComplete="nepInfo.send()">
    <s:layout>
        <s:VerticalLayout horizontalAlign="center" paddingTop="25"/>
    </s:layout>
    <fx:Declarations>
        <s:HTTPService id="nepInfo" url="http://www.epa.gov/owow/estuaries/nep_info.xml"/>
        <!--s:RadioButtonGroup id="optiongroup"/-->
    </fx:Declarations>
    <s:Panel title="NEP Project Information">
        <s:layout>
            <s:VerticalLayout/>
        </s:layout>
        <s:HGroup verticalAlign="middle">
    <mx:Form x="188" y="34" width="338">
    <mx:FormItem label="Search for NEP Information:">
    <s:DropDownList enabled="true" id="dropDownList" prompt="Select NEP" dataProvider="{nepInfo.lastResult.records.record}" labelField="nepName">
    </s:DropDownList>
    </mx:FormItem>
    </mx:Form>       
        </s:HGroup>   
        <mx:DataGrid id="resultsGrid"
                     dataProvider="{dropDownList.selectedItem}"
                     visible="{dropDownList.selectedItem != null}" x="20" y="62" width="1166" height="620">
            <mx:columns>
                <mx:DataGridColumn dataField="projectName" headerText="Project Name" wordWrap="true"/>
                <mx:DataGridColumn dataField="projectDescription" headerText="Project Description" wordWrap="true"/>
                <mx:DataGridColumn dataField="acres" headerText="Acres" wordWrap="true"/>
                <mx:DataGridColumn dataField="habitatDescription" headerText="Habitat Description" wordWrap="true"/>
                <mx:DataGridColumn dataField="neportCategory" headerText="Habitat Category" wordWrap="true"/>
                <mx:DataGridColumn dataField="restorationType" headerText="Restoration Type" wordWrap="true"/>
                <mx:DataGridColumn dataField="leadPartner" headerText="Lead Partner" wordWrap="true"/>
            </mx:columns>
        </mx:DataGrid>
    </s:Panel>
</s:Application>
XML: http://www.epa.gov/owow/estuaries/nep_info.xml
Thank you in advance for your help!
-Alison

($file, pwd);Assuming "pwd" is meant as the current directory, here a small example :
TEST@db102 SQL> create or replace procedure test_proc (p1 varchar2, p2 varchar2)
  2  is
  3  begin
  4     dbms_output.put_line (p1||' '||p2);
  5  end;
TEST@db102 SQL> /
Procedure created.
TEST@db102 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
$ ls -l /tmp/test/*.sql
-rw-r--r--  1 ora102 dba  69 Apr 18 23:23 /tmp/test/file1.sql
-rw-r--r--  1 ora102 dba 112 Apr 18 23:23 /tmp/test/file2.sql
-rw-r--r--  1 ora102 dba 120 Apr 18 23:23 /tmp/test/file3.sql
$ cat test_proc.sh
DIR=/tmp/test
cd $DIR
ls *.sql | while read file
do
        echo "Processing file $file"
        sqlplus -s test/test << EOF
set feed off
set pages 0
set serveroutput on
exec test_proc('$file', '`pwd`');
exit
EOF
done
$ ./test_proc.sh
Processing file file1.sql
file1.sql /tmp/test
Processing file file2.sql
file2.sql /tmp/test
Processing file file3.sql
file3.sql /tmp/test
$

Similar Messages

  • Can we create different reservation no for each auto PR created through PS.

    Hi Gurus
    With reference to above captioned subject, can we create different reservation no for each auto PR created through PS
    Thanks in advance
    Regards
    Abhijit Sen

    Hi,
    The reservation number will be same for all the material components in one network.
    so as long as there are "n" components in one networks then all the "'n" components will have the same reference number.
    If you need different reservation numbers then need to maintain those components in multiple networks.
    Hope its useful.
    Reward points if useful.
    Thanks..

  • Need a Firefox script to loop through a set of web pages

    Hi all,
    I was wondering if anyone had come across a script for this purpose?
    I need to power on a PC of mine, have it automatically start Firefox on startup (easy so far) then load a "loop" of predefined internal web pages that it keeps up on-screen for, say 5 seconds each webpage (5 pages in total that it would flick through)
    Is it also possible to script or force Firefox to open in Full screen mode?
    Thanks in advance,
    Chris

    Sounds more like you want a slide show, the only difference is if any of those web pages change. Quick check of addons: '''slide show seconds'''
    '''[http://example.com Tab Slideshow]''' (13.3 KB) :: Add-ons for Firefox
    -- Cycles through tabs as a slideshow. A minimalist extension that offers a configurable time to automatically switch to and display the next tab (and wrap around from the last to the first tab). The slideshow can be customized to auto-refresh tabs, as well as go into slideshow immediately when you open the browser. Extension offers a configurable time to automatically switch to and display the next tab (and wrap around from the last to the first tab).
    Quick HOW TO: To start and stop the slideshow, find the "Start Tab Slideshow" menu item under the "Tools" menu (or with Firefox 4 on recent Windows versions, the orange Firefox app button). To change delay and refresh settings, go to the Add-ons Manager, find the extension in the list, and click the Options button (or "Preferences" on a Mac).
    When in full screen, you can start/pause the slideshow by pressing ALT+T, and then T. (ALT+T: Open "Tools" menu; T: Start Tab Slideshow)
    https://addons.mozilla.org/firefox/addon/tab-slideshow/

  • Timing Issue - Running sqlplus for each script in a list of scripts

    I have a large number of folders with sql scripts that I need to run from windows with sqlplus. The problem is the scripts must be run in order. When I loop through the scripts and run sqlplus for each one, they sometimes fail because things in the prior script are not yet available.
    So I added a jdbc client that checks a table for when the data is available from the prior sqlplus script. It says yes the data is visible in the table so the script can launch the next SQLPlus process but it fails unless I put a 2 second sleep in.
    Because sqlplus doesn't have a "CD" command and there are limitations with SQL_PATH and relative imported child scripts, I'm afraid I'm stuck with running multiple sqlplus sessions.

    I should clarify that I'm looking for a way to run scripts in sequence with sqlplus. There is an issue where one sqlplus session commits and exits and the next starts but the commit is not yet available to the new sqlplus session. To me this is a bug with sqlplus but maybe someone can explain how this is a "feature".

  • How to create a add video for my website that loops continuously?

    I am creating a website and would like to know if I can add a video as a background for my website and loops countinously?
    Thanks for the reply.

    This is help you ? http://dfcb.github.com/BigVideo.js/  I like to Know too but i dont nothing about code.

  • XML for each in ..Loop statement

    Happy New Year,
    I just got XML to trace my desired results…Wow….
    But I need help in the.....
    Var c:Number = 0
    Var total:Number = 0
    for each (var property:XML in getPaid.revenue)
    c = c +1
    trace("total: " + c);
    The total is true or what I was looking for….
    Next….
    var c:Number = 0;
    for each (var property:XML in
    getPaid.revenue.(elements('revType') == 'Performance')
    c = c +1
    trace("total: " + c);
    This works too.
    BUT!
    for each (var property:XML in
    getPaid.revenue.(elements('revType') == 'Performance')
    c = c +1
    trace (c + " Song Title: " + getPaid.revenue.revTitle[c]
    + " Song Type: " + getPaid.revenue.revType[c]
    + " Total Amount: " + getPaid.revenue.revAmount[c]
    + " Account Name: " + getPaid.revenue.revName[c]);
    trace("total: " + c);
    Here the total is correct but if the total is 2 I get 3 items
    listed in the trace…even if I move the counter (c=c+1) below
    the trace statement…Help!
    Next…..
    for each (var property:XML in
    getPaid.revenue.(elements('revType') == 'Performance')
    && getPaid.revenue.(elements('revTitle') == 'Sister
    Love'))
    c = c +1
    trace("total: " + c);
    Here the second conditional is not seen…….
    Help…
    Next
    Var total:Number = 0
    for each (var property:XML in getPaid.revenue)
    c = c +1
    if (getPaid.revenue.(revTitle == "Sister Love"))
    d = d + 1;
    trace("total:" + c + getPaid.revenue.revTitle);
    trace("total: " + c);
    Here The if conditional isn’t seen…..
    What is the optimal way the read elements in the for each
    loop to test for two conditions.
    Sincerely,
    Anibus100
    PS Please show the answer in code…..
    XML Object
    var getPaid:XML = <revData>
    <revenue>
    <revName>KJAZZ</revName>
    <revTitle>Sister Love</revTitle>
    <revAmount>4,000.00</revAmount>
    <revDateIn>12/20/1990</revDateIn>
    <revDateOut>12/20/2009</revDateOut>
    <revType>Performance</revType>
    <revDescript>Radio Play</revDescript>
    </revenue>
    <revenue>
    <revName>J Records</revName>
    <revTitle>Sister Love</revTitle>
    <revAmount>85,000.00</revAmount>
    <revDateIn>1/4/1969</revDateIn>
    <revDateOut>1/4/1972</revDateOut>
    <revType>Mechanical</revType>
    <revDescript>CD License</revDescript>
    </revenue>
    <revenue>
    <revName>KDAY</revName>
    <revTitle>Get The Money</revTitle>
    <revAmount>3000.00</revAmount>
    <revDateIn>12/20/2003</revDateIn>
    <revDateOut>12/20/2003</revDateOut>
    <revType>Performance</revType>
    <revDescript>Radio Play</revDescript>
    </revenue>
    <revenue>
    <revName>AT&T</revName>
    <revTitle>Sister Love</revTitle>
    <revAmount>697.00</revAmount>
    <revDateIn>5/13/2006</revDateIn>
    <revDateOut>5/13/2008</revDateOut>
    <revType>New Media</revType>
    <revDescript>Cell Phone Ring Tone</revDescript>
    </revenue>
    <revenue>
    <revName>CBS TV</revName>
    <revTitle>Get The Money</revTitle>
    <revAmount>150,000.00</revAmount>
    <revDateIn>5/8/1988</revDateIn>
    <revDateOut>7/15/1988</revDateOut>
    <revType>Snychronzation</revType>
    <revDescript>TV China Beach</revDescript>
    </revenue>
    <revenue>
    <revName>Soul Train</revName>
    <revTitle>The Money</revTitle>
    <revAmount>7,000.00</revAmount>
    <revDateIn>2/25/2001</revDateIn>
    <revDateOut>2/25/2001</revDateOut>
    <revType>Synchronzation</revType>
    <revDescript>Radio Play</revDescript>
    </revenue>
    <revenue>
    <revName>Sheet Music Inc</revName>
    <revTitle>Sister Love</revTitle>
    <revAmount>450.00</revAmount>
    <revDateIn>12/20/1990</revDateIn>
    <revDateOut>12/20/1990</revDateOut>
    <revType>Performance</revType>
    <revDescript>Radio Play</revDescript>
    </revenue>
    <revenue>
    <revName>Town & Country </revName>
    <revTitle>Get The Money</revTitle>
    <revAmount>1,500.00</revAmount>
    <revDateIn>3/3/1998</revDateIn>
    <revDateOut>12/20/2009</revDateOut>
    <revType>New Media</revType>
    <revDescript>Web Site Intro. Music</revDescript>
    </revenue>
    <revenue>
    <revName>R & B Tee-Shirts, Inc</revName>
    <revTitle>Get The Money</revTitle>
    <revAmount>475.00</revAmount>
    <revDateIn>8/14/2006</revDateIn>
    <revDateOut>8/14/2008</revDateOut>
    <revType>Print</revType>
    <revDescript>Tee Shirt Logo</revDescript>
    </revenue>
    </revData>;

    Markus,
    No both suggestions did not work. I bet either you or someone
    close to you has the answer.
    for each (var property:XML in
    getPaid.revenue.(elements('revType') == 'Performance') &&
    getPaid.revenue.(elements('revTitle') == 'Sister Love'))
    I believe the error is in the && "and" ...Do have any
    tested solutions?
    error message # 1180
    I look forward to your rely.
    Sincerely,
    Anibus100

  • How to add totals for each page in main window

    hi
      i have problem in scripts
      how to add total in first page ending and carry it to second page , at the end of second page again adding total and so on until last page.
    very urgent
    regards
    ratna

    Hi,
    Check these
    http://help.sap.com/saphelp_40b/helpdata/en/d1/8035c3454211d189710000e8322d00/content.htm
    http://membres.lycos.fr/jolyeric/SAP/Note_de_Cours_Ben/Sapscript/SAPscript_Control_Commands.doc
    try to use the command 'summing' along with one text symbol .Keep the if condtion when page changes at that time u dispay the total as ur keeping the total in text symbol it can be dispayed in the next page
    or this is round about way
    loop at <table>.
    call write_form.
    endloop.
    here u declare a variable 'c' and increment it by 1 in each loop. Then u chgeck if the program has started printing second page then u can print the number of records before printing the next page.
    eg :
    data : c type c value '0'.
    loop at <table>.
    c = c + 1.
    call write_form.
    endloop.
    in form:
    check when the next page is being printed, then u can print the number
    of lines 'c'.
    Feel free to revert back.
    --Ragu

  • How do I create a start/stop button for each separate while loop within my program, when each of them does a different task?

    I have a multimeter VI with separate while loops to accomplish the different tasks of reading  voltage, current, etc. Each while loop has a stop button, but I need a button that will have to be pressed in order for the while loop to even start. I tried putting another while loop around the present one, but it still has to run once before it will stop. I want the user to have to press the button before it runs, because they interfere with each other.
    I am just learning so patience and your kind assistance is greatly appreciated!
    ElectroKate

    iZACHdx wrote:
    Hello,
    I'm not entirely clear with everything you have going on and what you want your final functionality to be, but you can use sequence structures to prevent a loop from starting until the user presses a button like this:
    -Zach
    I have to ask, why is an NI employee using examples using sequence frames? The same thing could be accomplished using data flow by simply wiring the value of the first stop button out of teh first while loop and connecting it to the second loop. This would then use data flow to control the sequence. Why show new users bad programming methods?
    As to the original question I would concur with altenbach on using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Add link for a script from Indesign menu

    Dear,
    Is it possible to add a new menu on Indesign top menu near help for exemple.
    And it is possible to lanche a script from it ?
    thanks !

    Look at ScriptMenuAction.jsx in the Scripting Guide Sample Scripts. Of course it can do anything that a script can do, since it is itself a script and scripts can run scripts.

  • Configuring Restart On property in Cronacle for running scripts in loop

    Hello all,
    We have a scenario where in we have run a script or job chain in a loop. The loop count is fixed, however the count is coming in from a parameter.
    - Could you tell us if the parameter value can be set dynamically as a result of execution of the previous job chain, if so how is it done. (As of now the default value of the parameter is being used)
    - Is Restart On property the only way to perform loop executions or is there any other effective way
    Thanks and Regards
    Raj

    Hi,
    You can also use a precondition in a job chain to have some jobs restarted for a certain number of times. You can use parameter values in the precondition too to determine when to break the loop.
    Regards,
    Anton.

  • Is there a plug in or add on for Hebrew script for firefox. Cos I can't find one. PS i@m very new at all this !

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/805318''
    I am relatively new at computing. what I need is the ability to type in Hebrew is this possible and how do I install whatever it is. Hope you can help. Thanks Sorceror

    Open new tabs on far right, restore pre Fx3.6 behavior, set '''browser.tabs.insertRelatedAfterCurrent''' to '''false''' in '''about:config'''
    For more information see item #36 in ...
    You can make Firefox 4.0.1 look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]
    '''''More information on configuration variables''' available in
    [http://kb.mozillazine.org/About:config_entries about:config (entries)] and for users not familiar with the process there is [http://kb.mozillazine.org/About:config about:config (How to change)] -- Specialized list of only [http://dmcritchie.mvps.org/firefox/tabs_config.htm Tabs configuration] variables.''

  • Single row table with for-each group loop to set variable.

    Hi: There is probably a simple answer for this but I have not found it ...
    I have a single row table to loop through a group to set a variable holding a running amount. I am not displaying the amount within the table however when I preview the report I see that the table is expanding (adding rows) for each loop.
    The single row table has 3 columns.
    1st column
    <?for-each:AC_GROUP?>
    2nd column
    <?xdoxslt:set_variable($_XDOCTX,'xAmtVar',xdoxslt:get_variable($_XDOCTX,'xAmtVar')+CURRENT_AMOUNT)?>
    3rd column
    <?end for-each?>
    Should I be using <?for each-group?> or something else. My requirement is to set the value of the variable with the running total but because the loop is adding rows for each value it loops through (even though not displayed), it is moving other areas of the layout off the page.
    Hope this makes sense. Thanks in advance.

    you can do it many ways.
    No need to loop
    You can create a variable and put the sum amount directly in that.
    <?doxslt:get_variable($_XDOCTX,'xAmtVar',sum(/AC_GROUP/CURRENT_AMOUNT))?>or
    loop thru and add like you do.
    <?for-each@inlines:AC_GROUP?><?xdoxslt:set_variable($_XDOCTX,'xAmtVar',xdoxslt:get_variable($_XDOCTX,'xAmtVar')+CURRENT_AMOUNT)?><?end for-each?>do give any space or enter character in word between them, just put this in a single form-field will do
    But as i said, i would certainly go with first option.

  • (For Each) component in OSB

    I am trying to use “For-Each” component to loop through the bulk message to be de-bulked and publish individual messages from the loop. However the loop does not execute multiple times. It goes through the for-each component only once. The bulk message is ";" separated text messages.
    There are about 4-5 different parameters to be set for the component; like count, index, in param and xpath.
    What best values to be put in them so that the component yields desired effects?
    Thanks in advance.

    Thanks for getting back on this.
    I have converted my input message to XML using MFL transform.
    Now the bulk messages in XML looks like following:
    <?xml version="1.0" encoding="UTF-8"?>
    <BUlkMessage>
    <Transaction>Message1</Transaction>
    <Transaction>Message2</Transaction>
    <Transaction>Message3</Transaction>
    <Transaction>Message4</Transaction>
    <Transaction>Message5</Transaction>
    </BUlkMessage>
    Following are the parameters of FOR-EACH component:
    For each variable: v_forEach
    XPath: v_XML.BUlkMessage.Transaction (here v_XML is the above XML)
    In Variable : v_XML
    Index Variable: i
    Count Variable: count
    With this the the flow used to exit the for each component with out getting executed.
    What correction needs to be done for execution of FOR-EACH component so that the loop would iterate for 5 times. i.e. same number of times that of the bulk message.
    Regards
    Subhendu

  • How to add a comment for each caption label present in a document?

    Hello everyone,
    I am trying to write a script to add comments for each caption label for figure and table.
    How can I select a caption and use Comments object for adding a comment?
    I tried using AutoCaptions list for going through all captions present in a document but Comments.Add function is not available with Caption object type.
    When I try adding a comment by selection manually I am able to add. Here is my piece of code.
    For Each objCaption In ActiveDocument.AutoCaptions
    objCaption.Comments.Add Range:=Para.Range, text:="[" & sIdLabel & sCurrentNumber & "]" & vbCrLf ' ID‘}
    ' increment number for next TAG
    sCurrentNumber = Format(Val(sCurrentNumber) + Val(sStepNumber), String(Len(sCurrentNumber), "0"))

    Hello Stefan,
    Thanks for your response.
    I'm trying to add comments for each table and figure present in my document.
    I have earlier tried a script to add comments for each outline level and it works.
    When I tried adding a feature to add comments for each caption in the document, it didn't work.
    Apparently when I try to go through the document by each para, captions are selected as para. So my current script is not able to parse though all the captions.
    Then I went with the other option where I'm trying to use AutoCaption object list to go through each caption. In this Caption object do not have Comment.Add function.

  • Looping through SQL statements in shell script

    Hello members,
    I'm working on the Solaris environment and the DB i'm using is Oracle 10g. Skeleton of what I'm attempting;
    Write a ksh script to perform the following. I have no idea how to include my sql query within a shell script and loop through the statements. Have therefore given a jist of what I'm attempting, below.
    1. Copy file to be processed (one file at a time, from a list of 10 files in the folder ).
    for i in *
               do
               cp $i /home/temp[/CODE]2 . Create a snapshot(n) table : Initialize n = 1 -- -- To create my snapshot table and inserts records in SQL
    create table test insert account_no, balance from records_all;3. Checking if the table has been created successfully:
    select count(*) from snapshot1 -- query out the number of records in the table -- always fixed, say at 400000
    if( select count(*) from snapshot(n) = 400000 )
    echo " table creation successful.. proceed to the next step "
    else
    echo " problem creating table, exiting the script .. "  4. If table creation is successful,
    echo " select max(value) from results_all " -- printing the max value to console
    5. Process my files using the following jobs:
    ./runscript.ksh - READ -i $m ( m - initial value 001 )
    ./runscript.ksh - WRITE -i $m ( m - initial value 001 -- same as READ process_id )
    -- increment m by 1
    6. Wait for success log
    tail -f log($m)* | -egrep "^SUCCESS"7. looping to step1 to :
    Copy file 2 to temp folder;
    create snapshot(n+1) table
    Exit when all the files have been copied for processing.
    done -- End of Step 1
    Pointers on getting me moving will be very valuable.
    thanks,
    Kris

    Hi,
    Are you inserting the data from file or from some table.
    If it is from file, I suggest sql loader would be better, I suppose.
    If it is from table, then something like this
    for i in *
               do
    sqlplus username/password@db_name<<EOF
                create table test select * account_no, balance from records_all;
    EOF
    exit
    doneAnurag

Maybe you are looking for

  • Sum of Key fig at Universe level

    Hi, I have created a Universe on the Top of SAP BW Cube. I have 5 Key fig in the Key fig class. My question - 1. Can i create a new key fig which contains the sum(Salary) , Assuming salary is the key fig exist in Universe. 2. What will be the syntex

  • Composite Video on eMac problem

    At my school I have a number of eMacs and I want to connect a few of them up to TV monitors. In the past I have been able to use the mini-vga to video adapter and connect it to the video input and have things work just fine. Recently, however, when I

  • Acrobat 8 shows in the dock but won't open

    I have a new installation of Acrobat Pro, along with PS5. Computer is a mac w/snow leopard. Question is Acrobat 8 shows in the dock but won't open - says PS must be open for it to work - but PS is open(and functioning fine). So how do I get Acrobat w

  • Problem relating painting swing component

    Hi All, I am making a swing application in which there is one central Panel on which i am showing some dynamic contents from database but the problem is that data is comming from database but it is not painted automatically on screen and when i move

  • 5800 XM problem

    Does the Nokia PC suites auto backup my contacts and messages..? or not..?? cuz i have a very important messages in there and contacts...i haved filed a criminal actions in the court and my evidence is my boss text message to me.. but when i updates