Iteration in OpenScript

Hi ,
I am in need of doing Iteration via Script in ATS OpenScript . so if have some idea , share me
Thanks in advance
Regards,
Maha

Hi
Next to the play icon in OpenScript there is an iterate icon, you need to click on that to set the number of iterations you like to do.
By the way if you have any more questions on OpenScript, please post them on the QA/Testing forum
Regards
Alex

Similar Messages

  • OpenScript ActionScript Error from Adobe Flash Player 9

    I get a popup ActionScript Error from Adobe Flash Player 9 when trying to record a Flex Tree object using OpenScript 9.2.1.0 Production. Specifically, I click on the Triangle that opens/closes the view of the child nodes underneath the parent node of a Tree. Initially, the triangle arrow already pointing down and the child node is already showing. When I click on the triangle, the node underneath goes up and disappears under its parent node and the traingle is then pointing to the parent node.
    When I click this triangle in Firefox without OpenScript recording, I don't get any errors, popups, or issues. It seems to work correctly. During OpenScript recording, the recording seems to crash with a popup that is titled "Adobe Flash Player 9" and has the text "An ActionScript error has occurred" with the following error message:
    Error: Unable to find automation method 'mx.events.TreeEvent' for class '[object OSAutomationClass]'.
         at mx.automation::AutomationManager/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:1680]
         at mx.automation.delegates.core::UIComponentAutomationImpl/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\delegates\core\UIComponentAutomationImpl.as:281]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::dispatchTreeEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:3334]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::onTweenEnd()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:2193]
         at mx.effects::Tween/endTween()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:524]
         at mx.effects::Tween/http://www.adobe.com/2006/flex/mx/internal::doInterval()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:565]
         at mx.effects::Tween$/timerHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:179]
         at flash.utils::Timer/_timerDispatch()
         at flash.utils::Timer/tick()
    I can click "Dismiss All" from the Adobe popup and Firefox isn't affected. Openscript doesn't appear to have any issues and the recording can be continued or stopped. It records the click on the tree and the "Dismiss All" from the popup both as "Click object("@id='main'") as type "web" instead of "flexFT".
    I am using OATS 9.2.1.0 with Firefox 3.6.17. I am testing a Flex 3.3 SDK built application. I installed the Adobe Flash Player 9 that came with the Flex SDK 3.3 before installing OATS.
    Any help on this issue is greatly appreciated.
    Some other information that may prove to be useful: I cannot seem to get OpenScript to consistently play back the actions on the same tree described above. Sometimes it works and sometimes it does not. I've tried using "Select Tree", "Select List", and "Click Tree" and each one is inconsistent on playback. It will report "Target Not Found".
    I have the console output for a "Target Not Found" failure below, where line 100 is ".select("GRID1>server1", TriggerEvent.Mouse," from the following Java generated on recording with OpenScript:
    flexFT
    .list(
    15,
         "/web:window[@index='0' or @title='My Title']/web:document[@index='0']/flex:application[@automationIndex='index:-1' and @label='' and @className='main' and @automationName='main' and @automationClassName='FlexApplication' and @id='main']/flex:canvas[@automationIndex='index:1' and @label='' and @className='mx.containers.Canvas' and @automationName='mainCanvas' and @automationClassName='FlexCanvas' and @id='mainCanvas']/flex:dividedBox[@automationIndex='index:16' and @label='' and @className='view.MainMediator' and @automationName='mediator' and @automationClassName='FlexDividedBox' and @id='mediator']/flex:accordion[@label='' and @automationName='index:0' and @id='null' and @automationIndex='index:0' and @className='mx.containers.Accordion' and @automationClassName='FlexAccordion']/flex:canvas[@automationIndex='index:1' and @label='My%20View2' and @className='view.my.MyNavigator' and @automationName='My%20View2' and @automationClassName='FlexCanvas' and @id='null']/flex:canvas[@label='' and @automationName='index:1' and @id='null' and @automationIndex='index:1' and @className='mx.containers.Canvas' and @automationClassName='FlexCanvas']/flex:list[@automationIndex='index:2' and @className='view.MyGridTree' and @automationName='index:2' and @automationClassName='FlexList' and @id='null']")
    .select("GRID1>server1", TriggerEvent.Mouse,
         KeyModifier.None);
    think(1.0);
    Console Output:
    11:29:09,093 INFO [EntryPoint] Started with arguments: -port 7777 -jwg C:\OracleATS\OFT\test06_ff\test06_ff.jwg
    11:29:09,250 INFO [EntryPoint] Received StartScriptEvent
    11:29:09,250 INFO [EntryPoint] Running "test06_ff" ...
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.utilities.api.UtilitiesService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.browser.api.BrowserService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.webdom.api.WebDomService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.flexFT.api.FlexFTService"
    11:29:09,484 INFO [1] Initializing VU 1 for script test06_ff
    11:29:21,546 INFO [1] Step: [1] Redirect (/Page1/)
    11:29:21,718 INFO [1] Step: [2] Login Page (/main.html)
    11:29:32,218 INFO [1] Step: [3] My Title (/main.html)
    11:30:11,453 ERROR [1] Error in section Run at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:11,453 ERROR [1] Iteration 1 failed at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:12,468 INFO [1] Finished VU 1 for script test06_ff
    Thanks,
    John

    I get a popup ActionScript Error from Adobe Flash Player 9 when trying to record a Flex Tree object using OpenScript 9.2.1.0 Production. Specifically, I click on the Triangle that opens/closes the view of the child nodes underneath the parent node of a Tree. Initially, the triangle arrow already pointing down and the child node is already showing. When I click on the triangle, the node underneath goes up and disappears under its parent node and the traingle is then pointing to the parent node.
    When I click this triangle in Firefox without OpenScript recording, I don't get any errors, popups, or issues. It seems to work correctly. During OpenScript recording, the recording seems to crash with a popup that is titled "Adobe Flash Player 9" and has the text "An ActionScript error has occurred" with the following error message:
    Error: Unable to find automation method 'mx.events.TreeEvent' for class '[object OSAutomationClass]'.
         at mx.automation::AutomationManager/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:1680]
         at mx.automation.delegates.core::UIComponentAutomationImpl/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\delegates\core\UIComponentAutomationImpl.as:281]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::dispatchTreeEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:3334]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::onTweenEnd()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:2193]
         at mx.effects::Tween/endTween()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:524]
         at mx.effects::Tween/http://www.adobe.com/2006/flex/mx/internal::doInterval()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:565]
         at mx.effects::Tween$/timerHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:179]
         at flash.utils::Timer/_timerDispatch()
         at flash.utils::Timer/tick()
    I can click "Dismiss All" from the Adobe popup and Firefox isn't affected. Openscript doesn't appear to have any issues and the recording can be continued or stopped. It records the click on the tree and the "Dismiss All" from the popup both as "Click object("@id='main'") as type "web" instead of "flexFT".
    I am using OATS 9.2.1.0 with Firefox 3.6.17. I am testing a Flex 3.3 SDK built application. I installed the Adobe Flash Player 9 that came with the Flex SDK 3.3 before installing OATS.
    Any help on this issue is greatly appreciated.
    Some other information that may prove to be useful: I cannot seem to get OpenScript to consistently play back the actions on the same tree described above. Sometimes it works and sometimes it does not. I've tried using "Select Tree", "Select List", and "Click Tree" and each one is inconsistent on playback. It will report "Target Not Found".
    I have the console output for a "Target Not Found" failure below, where line 100 is ".select("GRID1>server1", TriggerEvent.Mouse," from the following Java generated on recording with OpenScript:
    flexFT
    .list(
    15,
         "/web:window[@index='0' or @title='My Title']/web:document[@index='0']/flex:application[@automationIndex='index:-1' and @label='' and @className='main' and @automationName='main' and @automationClassName='FlexApplication' and @id='main']/flex:canvas[@automationIndex='index:1' and @label='' and @className='mx.containers.Canvas' and @automationName='mainCanvas' and @automationClassName='FlexCanvas' and @id='mainCanvas']/flex:dividedBox[@automationIndex='index:16' and @label='' and @className='view.MainMediator' and @automationName='mediator' and @automationClassName='FlexDividedBox' and @id='mediator']/flex:accordion[@label='' and @automationName='index:0' and @id='null' and @automationIndex='index:0' and @className='mx.containers.Accordion' and @automationClassName='FlexAccordion']/flex:canvas[@automationIndex='index:1' and @label='My%20View2' and @className='view.my.MyNavigator' and @automationName='My%20View2' and @automationClassName='FlexCanvas' and @id='null']/flex:canvas[@label='' and @automationName='index:1' and @id='null' and @automationIndex='index:1' and @className='mx.containers.Canvas' and @automationClassName='FlexCanvas']/flex:list[@automationIndex='index:2' and @className='view.MyGridTree' and @automationName='index:2' and @automationClassName='FlexList' and @id='null']")
    .select("GRID1>server1", TriggerEvent.Mouse,
         KeyModifier.None);
    think(1.0);
    Console Output:
    11:29:09,093 INFO [EntryPoint] Started with arguments: -port 7777 -jwg C:\OracleATS\OFT\test06_ff\test06_ff.jwg
    11:29:09,250 INFO [EntryPoint] Received StartScriptEvent
    11:29:09,250 INFO [EntryPoint] Running "test06_ff" ...
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.utilities.api.UtilitiesService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.browser.api.BrowserService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.webdom.api.WebDomService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.flexFT.api.FlexFTService"
    11:29:09,484 INFO [1] Initializing VU 1 for script test06_ff
    11:29:21,546 INFO [1] Step: [1] Redirect (/Page1/)
    11:29:21,718 INFO [1] Step: [2] Login Page (/main.html)
    11:29:32,218 INFO [1] Step: [3] My Title (/main.html)
    11:30:11,453 ERROR [1] Error in section Run at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:11,453 ERROR [1] Iteration 1 failed at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:12,468 INFO [1] Finished VU 1 for script test06_ff
    Thanks,
    John

  • How to automate Drop Down menu in OpenScript

    Hello Team,
    Can someone help me in automating a drop down menu? The following is what I'm trying to achieve
    For iteration 1 the first value from the drop down menu should be selected, continue rest of the task as per the initial record
    for iteration 2 the second value from the drop down menu should be selected.. and so on till all the values in the drop down are selected.
    I guess we should use for loop? I tried most of the option as per the user guide but unfortunately I wasn't able to crack it :( can some one tell me what to do from the Tree view of the openscript? Alex (guru) can you please throw some light on this :)
    N.B: I was able to make a field data driven!
    Thanks

    Hello,
    Thanks for your reply, please find the drop down box record script. From the below you can see first I selected Accounting from the drop down & then later i selected Administration..similarly if i want to select all the values from the drop down what do i need to do? Do i add a for loop? if yes where do i add them from the Tree view & how. I somehow can't understand the user guide. Or maybe Im not thinking right! Kindly help. I have figured out how to run data driven test from an input file, however in this case I can't possibly add all the values from the drop down in an input file also that approach isn't healthy!
                   web
                             .selectBox(
                                       5,
                                       "/web:window[@index='0' or @title='SEEK - Australia's no. 1 jobs, employment, career and recruitment site - Microsoft Internet Explorer']/web:document[@index='0']/web:form[@id='layout' or @name='layout' or @index='0']/web:select[(@id='catindustry' or @name='catindustry' or @index='0') and multiple mod 'False']")
                             .selectOptionByText("Accounting");
                             .selectBox(
                                       16,
                                       "/web:window[@index='0' or @title='SEEK - Australia's no. 1 jobs, employment, career and recruitment site - Microsoft Internet Explorer']/web:document[@index='0']/web:form[@id='layout' or @name='layout' or @index='0']/web:select[(@id='catindustry' or @name='catindustry' or @index='0') and multiple mod 'False']")
                             .selectOptionByText("Administration");

  • Openscript response in SQL Call Procedure

    Hi,
    How do we get the response data from an SQL Call Procedure, in Openscript?
    The SQL Statement is "call pkg_aaa.aaa(?)".
    The Details view does not seem to give any results. The procedure is supposed to output a string.
    Regards,
    Axel
    Edited by: ao on 2011-jun-09 10:51

    Can you help, the solution please. Thanks.
    I have this script:
    utilities.getSQLService().callProcedure(null,"DESA3",
                        "Begin\n BMEP_EXECUTA_VALIDACION(?,?,?);\n End;",
                        utilities.parameters(SQLService.parameter("{{db.par1.10}}", SQLService.SQLParameterType.In),
                                  SQLService.parameter("{{db.par1.10}}", SQLService.SQLParameterType.In),
                             SQLService.parameter("abc",SQLService.SQLParameterType.Out)))
    Error when executing:
    Results 05-09-2012 12:26:04 AM     2,007               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Script BaseDeDatos1     2,007               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Initialize BaseDeDatos1     0,507               Passed          
    DefineDatabase: DESA3     0,001               Passed          
    Parameterize SQL: Begin
    BMEP_EXECUTA_VALIDACION('20','20',?);
    End;     0,001               Passed          
    Run BaseDeDatos1 - Iteration 1     1,325               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    GetNextDatabankRecord: par1     0,002               Passed     Data Used:[20]      
    Connect to Database: 'DESA3'     0,787               Passed          
    Call Procedure DESA3: 'Begin
    BMEP_EXECUTA_VALIDACION(?,?,?);
    End;'     0,25               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Data Used:20      
    Finish BaseDeDatos1     0,053               Passed          
    End Script BaseDeDatos1     2,007               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    I try, but :(
    Edited by: user2810993 on 05-sep-2012 6:03
    Edited by: user2810993 on 05-sep-2012 6:07
    Edited by: user2810993 on 05-sep-2012 6:07

  • Openscript runScript.bat very slow

    Hi,
    Are there any performance settings that can be done for the runScript.bat file? Playback gets very slow after just 20 iterations and Java consumes a lot of memory and CPU.
    I have a functional script to set up test accounts from a databank, so I need to do 1000 iterations or so.
    //A

    Hi
    For 1 iteration itself, runScript.bat command line execution is taking a lot of time than we execute from openscript editor. Have you got any solution for this...can you please share.
    Thanks
    Sreenath

  • Openscript / script chaining / how to run all the scripts if one fails ?

    Hello,
    I have a problem using openscript and please I would like to know if there is a work around.
    here is what I am doing :
    with open script:
    1/ I am recording many differents scripts for the same app : one script = one functionnality
    2/ Then I am creating a script and I run all these previous script.
    The problem is :
    I get an error "Timeout occurred waiting for page to load." which is a normal error (the link is broken, the page is missing etc).
    I cannot recover, and main script stops. Although I would like others scripts also to be played back.
    I tried to set option ERR_RESPONSE_TIME_ERROR to Warn (instead of fail). But no way ! It fails !
    please could you tell me what I am missing ?
    thank you.
    Michael
    Edited by: user12252276 on 24 nov. 2009 01:38

    I dont have dependancies between scripts. I mean I did be careful : each script open and close properly the browser.
    Even by setting ALL parameters to Warn instead of fail, this does not help.
    Error : Timeout occurred waiting for page to load cannot be skipped this way.
    In my run I have 4 Runscript. 2nd fails with this error. 3 and 4 will not be (even) tried.
    Never mind. Try/Catch should be working :-) (I hope so)
    thanks.
    Michael.
    14:24:26,960 ERROR [IteratingVUser] Script ATHCASE. Error in section Run
    oracle.oats.scripting.modules.webdom.common.api.exception.PlaybackException: Timeout occurred waiting for page to load.
         at oracle.oats.scripting.modules.webdom.common.api.exception.PlaybackException.createWaitForPageTimeoutException(PlaybackException.java:46)
         at oracle.oats.scripting.modules.webdom.api.elements.DOMBrowser.handleWaitforPageException(DOMBrowser.java:152)
         at oracle.oats.scripting.modules.webdom.api.elements.DOMBrowser.waitForPage(DOMBrowser.java:110)
         at script.run(script.java:85)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:262)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.insertScriptRun(IteratingVUser.java:280)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.runScript(IteratingVUser.java:621)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.runScript(IteratingVUser.java:593)
         at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.runScript(IteratingVUserScript.java:458)
         at script.run(script.java:24)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:262)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:632)
         at java.lang.Thread.run(Thread.java:619)
    14:24:27,050 ERROR [1] Error in section Run at line (script.java:24). Timeout occurred waiting for page to load.
    oracle.oats.scripting.modules.webdom.common.api.exception.PlaybackException: Timeout occurred waiting for page to load.
         at oracle.oats.scripting.modules.webdom.common.api.exception.PlaybackException.createWaitForPageTimeoutException(PlaybackException.java:46)
         at oracle.oats.scripting.modules.webdom.api.elements.DOMBrowser.handleWaitforPageException(DOMBrowser.java:152)
         at oracle.oats.scripting.modules.webdom.api.elements.DOMBrowser.waitForPage(DOMBrowser.java:110)
         at script.run(script.java:85)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:262)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.insertScriptRun(IteratingVUser.java:280)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.runScript(IteratingVUser.java:621)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.runScript(IteratingVUser.java:593)
         at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.runScript(IteratingVUserScript.java:458)
         at script.run(script.java:24)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:262)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:632)
         at java.lang.Thread.run(Thread.java:619)
    14:24:27,050 ERROR [1] Iteration 1 failed at line (script.java:24). Timeout occurred waiting for page to load.
    oracle.oats.scripting.modules.webdom.common.api.exception.PlaybackException: Timeout occurred waiting for page to load.
         at oracle.oats.scripting.modules.webdom.common.api.exception.PlaybackException.createWaitForPageTimeoutException(PlaybackException.java:46)
         at oracle.oats.scripting.modules.webdom.api.elements.DOMBrowser.handleWaitforPageException(DOMBrowser.java:152)
         at oracle.oats.scripting.modules.webdom.api.elements.DOMBrowser.waitForPage(DOMBrowser.java:110)
         at script.run(script.java:85)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:262)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.insertScriptRun(IteratingVUser.java:280)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.runScript(IteratingVUser.java:621)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.runScript(IteratingVUser.java:593)
         at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.runScript(IteratingVUserScript.java:458)
         at script.run(script.java:24)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:262)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:632)
         at java.lang.Thread.run(Thread.java:619)
    14:24:27,390 INFO [1] Finished VU 1 for script repeat

  • OATS - Playback is not working in OpenScript for Load Testing with Web/Http

    Hi,
    I am able to record the script in Open Script successfully, but when I try to playback the same without making any changes....its fails with error : Failed to solve variable web.input.Submit using path .//input[@name='Submit']/@value
    I have already commented the part where password will be matched in the code....thus, login/bad credentials related issues is ruled out as well.
    Please help with me some solution.
    Following is the recorded script:
    import oracle.oats.scripting.modules.basic.api.internal.*;
    import oracle.oats.scripting.modules.basic.api.*;
    import oracle.oats.scripting.modules.http.api.*;
    import oracle.oats.scripting.modules.http.api.HTTPService.*;
    import oracle.oats.scripting.modules.utilities.api.*;
    import oracle.oats.scripting.modules.utilities.api.sql.*;
    import oracle.oats.scripting.modules.utilities.api.xml.*;
    import oracle.oats.scripting.modules.utilities.api.file.*;
    public class script extends IteratingVUserScript {
        @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
        @ScriptService oracle.oats.scripting.modules.http.api.HTTPService http;
        public void initialize() throws Exception {
            http.setUserAgent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.2)");
            http.setAcceptLanguage("en-US");
         * Add code to be executed each iteration for this virtual user.
        public void run() throws Exception {
            beginStep("[1] FLEXCUBE - PRIVATE BANKING", 0);
                http.window(2, "window[@index='0']").get(
                        "http://10.180.59.185:9500/wm", null, null, true, "UTF8",
                        "UTF8");
                    http.solveXPath("web.input.Submit", "/window[@index='0']",
                            ".//input[@name='Submit']/@value", "Sign In", 0,
                            EncodeOptions.None);
                    http.solveXPath("web.input.strutstokenname",
                            "/window[@index='0']",
                            ".//input[@name='struts.token.name']/@value",
                            "struts.token", 0, EncodeOptions.None);
                    http.solveXPath("web.input.strutstoken", "/window[@index='0']",
                            ".//input[@name='struts.token']/@value",
                            "CFSZKA9Z6RSWJTW8TT35GXCNIOIGMJGA", 0,
                            EncodeOptions.None);
            endStep();
            beginStep("[2] FLEXCUBE - PRIVATE BANKING - Home", 8538);
                http.form(
                        14,
                        "window[@index='0']//form[((@id='formLogin' and @name='formLogin') or @action='http://10.180.59.185:9500/wm/j_spring_security_check;jsessionid=B8396BEC73D829538F5E55FEE125330D') and @index='0']")
                        .submit(null,
                                http.postdata(
                                        http.param("j_username", "HOHEAD1"),
                                        http.param("j_password",
                                                "a99fad1866af01d9375627d5d08d7f1c11ed4d3f6d5d2372d40908884a15b8e6"),
                                        http.param("Submit",
                                                "{{web.input.Submit,Sign In}}"),
                                        http.param("struts.token.name",
                                                "{{web.input.strutstokenname,struts.token}}"),
                                        http.param("struts.token",
                                                "{{web.input.strutstoken,CFSZKA9Z6RSWJTW8TT35GXCNIOIGMJGA}}")),
                                null, true, null, null, null, null, null);
            endStep();
            beginStep("[3] FLEXCUBE - PRIVATE BANKING", 9875);
                http.link(
                        28,
                        "window[@index='0']//a[@text='Logout' and (@href='http://10.180.59.185:9500/wm/logout.jsp?logoutToken=0.1189281079747162' or @index='159')]")
                        .click();
            endStep();
        public void finish() throws Exception {

    Hi,
    I think your password is encrypted. Try replace password "a99fad1866af01d9375627d5d08d7f1c11ed4d3f6d5d2372d40908884a15b8e6" with your password.
    Or Get output of obfuscate("your password") and replace "a99fad1866af01d9375627d5d08d7f1c11ed4d3f6d5d2372d40908884a15b8e6" with {{@deobfuscate( output of obfuscate("your password") )}}
    Regards,
    Deepu M

  • Query update on each iteration problem (MS SQL Sever / ODBC / Native Driver

    Hello,
    I�ve been working to learn some Java and now JDBC over the past 10 or so months.
    I think I have a general understanding of how to perform queries and work with data using JDBC. However, I�ve run into a problem. I�m trying to do a query of a set of data in a database based on the value of a status column. I want to loop over the messages and perform various functions with the data then update their status in the database. It�s preferable to do these 250 to 1000 rows at a time, but no more and no less.
    I�m connecting to MS SQL Server 2000, currently with ODBC. I�ve also tried it with the Java SQL Server 2000 drivers provided by Microsoft with the same results.
    I�ve found that I can do a one table query and loop though it with a while (rs.next()) {�} and run an Update statement with executeUpdate on each iteration without any problems, no matter the number of rows returned in query.
    I have not been able to use the updateString and updateRow inside the while loop. I keep getting errors like this at the line with the updateRow():
    Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Row update failed.
    This occurs no mater how many rows I select, 1 or more.
    The real problem I�ve been having is that the query I need to loop though joins across several tables and returns some rows from some of those tables. This only seems to work when I query for 38 or less selected rows and I use an Update statement with executeUpdate on each iteration. The updateString and updateRow methods never work. Any number of rows selected greater than 38 causes a deadlock where the Update is waiting for the select to compete on the server and the Update can�t proceed until the Select is complete.
    As I stated above I�ve tried both ODBC and the native SQL Server driver with the same results. I have not tried any other databases, but that�s moot as my data is already in MS SQL.
    Questions:
    How can I avoid or get around this 38 row limit without selecting each row, one at a time?
    What am I doing wrong with the updateString and updateRow?
    Is there a better approach that anyone can suggest?
    Here�s some sample code with the problem:
    import java.sql.*;
    public class db1{
         public static void main(String[] args) throws Exception{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String url = "jdbc:odbc:eBrochure_live";
              Connection con = DriverManager.getConnection(url, "sa", "d3v3l0p");
              Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
              Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://dcm613u2\\dcm613u2_dev:1433", "sa", "d3v3l0p");
              Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
              Statement stmt2 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
              stmt.executeUpdate("USE [myDatabase]");
              stmt2.executeUpdate("USE [myDatabase]");
              String qGetMessages = "SELECT TOP 250 t1.messageUUID, t1.subjectHeader, t2.emailAddress as toAddress " +
              "FROM APP_Messages as t1 JOIN APP_addressBook_contacts as t2 " +
              "     On t1.toContactID = t2.contactID " +
              "WHERE t1.statusID = 'queued'";
              ResultSet rs = stmt.executeQuery(qGetMessages);
              while (rs.next()) {
                   String messageUUID = rs.getString("messageUUID");
                   String subjectHeader = rs.getString("subjectHeader");
                   System.out.println(messageUUID + " " + subjectHeader);
                   String updateString = "UPDATE APP_Messages " +
                        "SET statusID = 'sent' " +
                        "WHERE messageUUID = '" + messageUUID + "' ";
                   stmt2.executeUpdate(updateString);
              con.close();
    Thanks for the help,
    Doug Hughes

    // sorry, ps.close() should be outside of if condition
    String sql = "UPDATE APP_Messages SET statusID = 'sent' WHERE messageUUID = ?";
    Statement statement = con.createStatement();
    PreparedStatement ps = con.prepareStatement(sql);
    ResultSet rs = statement.executeQuery("your select SQL");
    if ( rs.next() )
    ps.clearParameters();
    ps.setString(1, rs.getString("your column name"));
    ps.executeUpdate();
    ps.close();
    rs.close();
    statement.close();

  • Not able to update data in iterator

    Our scenario is something like this:
    We do not directly bind UI components to VO, that is, for example we do not directly drag and drop a VO as a table. Instead we use POJO to exchange data between the UI and model layers.
    Our requirement is to show form with pagination. If there are 5 records we show each record in form layout with navigation keys to show next, previous, first and lat records.
    Since we do not bind the data directly to VO, the form data is coming from pojo. Our implementation is as below
    A java class named personPojo with fields
    fname
    lname
    code
    A method getAllPersons which queries all the person records from db table, populates it in a list<personPojo> and returns this list.
    We are using an iterator which is based on this List<personPojo> that is returned from the method. Inside this iterator we have a panelFormLlayout with input components mapped to the pojo fields as below
    <af:iterator value="sampleBackingBean.getAllPersons" var="row"
                   id="i4">
              <af:inputText value="#{row.fname}" id="it6">
    <af:inputText value="#{row.lname}" id="it7">
    <af:inputText value="#{row.code}" id="it8">
         </af:iterator>
    The problem we are facing is, when we update the fields in the form, the data is not getting stored in the field of the pojo. That is, if currently 3rd record/element is shown from the list and we update name to "John". Then click on next button to go to next record and update name to "Smith". Now on clicking previous, we should be able to see the name "John", instead in our case no data is shown. But, if we hard code the data in the list, then the list shows the data properly. The issue is when we update it does not show the updated value as it is not getting set in the pojo. We have made sure the pagination works fine, that is clicking next or previous is correctly showing the records
    Can you please let us know what we may be missing here or if you have any other suggestions to implement a form with pagination

    hi,
    Hope following useful
    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_iterator.html
    http://blogs.oracle.com/shay/entry/working_with_the_afiterator_co

  • What is difference between Iterator and Collection Wrapper?

    Hi all,
                  I dont understand the actual difference between Iterator and Collection Wrapper. I observed both are used for the same purpose. Could any one please let me know when to use Collection Wrapper and when to use Iterator??
    Thanks,
    Chinnu.

    L_Kiryl is right.
    Collections support global iteration (through collection->get_next( )) and local iteration (through iterator->get_next( )).
    Each collection has a focus object. Initially, the first object has the focus.
    Any global iteration moves the focus, which is published by the event FOCUS_CHANGED of the collection.
    If you want to iterate on the collection without moving the focus (and without triggering timeconsuming follow-up processes) you can use local iteration. To do so, request an iterator object from the collection and use this to iterate.
    And one more advantage of using iterator: it takes care of deleted entities. If you use global iteration then when you reach deleted entity it will be an exception. But there is no exception with iterator in the same situation.

  • InputText value is not getting updated in Iterator

    Hi All,
    We are using jdeveloper 11.1.1.5.
    I have having 2 bounded taskflows TF1 and TF2. In TF1 I am having Page1.jspx and in
    TF 2 I have Page2.jspx.
    I am having 1 page fragment Frag1.jsff inside that I am having 1 textbox and a button. Text box is binded to the iterator "iter1".
    In Page1.jspx I have added fragment as a region and also I have added the iterator "iter1" in the bindings of page1.jspx
    On page load I am getting the value in the text box after that I am updating the text
    box value and on click of button I am trying to get the text box value using
    following methods.
    (1) Finding the Iterator getting the row and then finding the value as
    Row.getAttribute("Name");
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("IName of the Iterator");
    Row row = dciter.getRowAtRangeIndex(0);
    row.getAttribute("Name of the attribute);
    (2) Finding the RichSelectOneChoice component and then getting value
    RichSelectOneChoice textbox= jsfUtils.findComponentInRoot("ID of the component");
    textbox.getValue();
    (3) Using the page definition attribute as :-
    +jsfUtils.resolveExpression("#{data.PageDefName.inputtextname.inputValue}");+
    Every time I am getting null value. Is there anything I am missing here.
    When I applied autosubmit="true" property on the textbox I am getting value from the
    1st method.
    *Question 1 : - Is it necessary to use autosubmit property on the text box for the values to get updated in Iterator ?*
    *Question 2 : - Why I am not able to find the value using 2nd method ?*
    *Question 3 : - Is there anything wrong in getting value from page definition using 3rd method?*
    Now When on click on button on page1 on some condition, I am navigating it to page2
    and there is a button on page2 which invokes the TaskFlow return activity and so
    returning back to TF1.
    Now again I am clicking on the button on page1 but this time again I am getting value
    of the textbox as null using all the methods :(
    I have checked various post and tried putting *changeEvent="ppr"* in ur pageDef
    against the respective VO entry but still after returning back from TF2 to TF1 values
    are lost in the Iterator.
    I tried sharing data control with calling taskflow but still I am not getting the
    updated values.
    Please suggest.
    Thanks in advance.
    --NavinK

    Hi Suresh,
    I already have autoSubmit=true for input text and partialSubmit=true for button but still getting the same error.
    --Navin K                                                                                                                                                                                                                                                                                       

  • OTM: OpenScript fail due to

    Hi,
    When I run an OpenScript in OTM it fails even though it runs fine in OOS. OTM gets as far as logging into PeopleSoft, but no further. The script was created using FT-Oracle EBS/Forms.
    According to the ResultsReport:
    Object not found: /web:window[@index='0' or @title='Employee-facing registry content']/web:document[@index='0']/web:a[@text='Campus Community' or @href='http://192.168.55.3:8000/psp/PSHRM89/EMPLOYEE/HRMS/s/WEBLIB_PTPP_SC.HOMEPAGE.FieldFormula.IScript_AppHP?pt_fname=HCCC_BUILD_COMMUNITY&FolderPath=PORTAL_ROOT_OBJECT.HCCC_BUILD_COMMUNITY&IsFolder=true' or @index='54'].
    I noticed the default workspace and repository are situated in the OFT folder and not the OpenScript folder. Every new workspace added in OOS ends up in /OFT/. Could this be the cause?
    Henri

    I had similar problem earlier.
    Now, please note that your script developed in Open Script is properly added in OTM. Also, it looks you are working on people soft application. You can use web to record instead of Oracle EBS
    Steps to add openscript in OTM
    OTM > Tests Tab > Click Add >1) Give a name say Test1 >
    2) TYPE (Select Oracle Open Script) ** important
    3) Repository (click Find to select your script)
    4) Owner & Priority are required fields.
    5) Save & Execute.
    Add proper wait time like web.window(15,"/web:window[@index='0' or @title='Base Navigation Page']").waitForPage(5); as the script execution form OTM is much faster than in Open Script.
    You have only OFT folder in OracleATS (Installation folder) and no OpenScript folder if you have enoticed.
    Make sure you script is saved in D:\OracleATS\OFT\Default! folder if you have not created a new workspace.
    THanks
    Bhaskar

  • Displaying the results of an iterator in JTextfields.

    Hi people,
    I have got two methods which basically iterate through statements (forward and back).
    However I have a separate class which is basically the GUI for my program. I want the user to be able to click the next button and it iterates through the list and displays the element in the list in the JTextField.
    The problem I am having is that it will not display the element in the predefined fields, does anyone know how I can go about this? My code for my two methods is below:
    public void MusicNext()
               try
               if(titerator==null)
                   titerator = iList.listIterator();
               if(titerator.hasNext())
                   System.out.println(titerator.next());//Just prints out the iterator atm.
               else
                  titerator = null;
                  MusicNext();
               catch(ConcurrentModificationException ex)
                  titerator = iList.listIterator();
                  System.out.println("Iterator has been reset.");
              public Music MusicNext(String pTitle)
                Music tTitle = null;
             boolean found = false;
                Iterator it = iList.iterator();
                if(it.hasNext() && !found)
              tTitle = (Music) it.next();
              found = tTitle.getTitle().equalsIgnoreCase(pTitle);
                return tTitle;
            public void MusicPrevious()
               try
               if(titerator==null)
                   titerator = iList.listIterator();
               if(titerator.hasPrevious())
                   System.out.println(titerator.previous());//Just prints out the iterator atm.
               else
                  titerator = null;
               catch(ConcurrentModificationException ex)
                  titerator = iList.listIterator();
                  System.out.println("Iterator has been reset.");
               catch(NoSuchElementException ex)
                  //titerator = iList.listIterator();
                  System.out.println("No such element.");
         }I am pretty sure they shouldn't be void but should return an element, but I am really not sure what to return.
    Many Thanks,
    Rob.
    (Sorry I posted this before but I left out alot of detail).

    Don't get or instantiate the iterator in often-called methods.
    It should be get or instantiated as a class global field once and for all.
    Your ListIterator is good for such treatment becuase it can be
    freely scanned backward, while Iterator can't.

  • How to pick max value from a column of a table using cursor and iteration

    Hello Everybody
    I have a table loan_detail
    and a column in it loan_amount
    now i want to pick values from this table using cursor and then by using iteration i want to pick max value from it using that cursor
    here is my table
    LOAN_AMOUNT
    100
    200
    300
    400
    500
    5600
    700i was able to do it using simple loop concepts but when i was trying to do this by using cursor i was not able to do it .
    Regards
    Peeyush

    SQL> SELECT MAX(sal) Highest_Sal,MIN(sal) Lowest_Sal FROM emp;
    HIGHEST_SAL LOWEST_SAL
           5000        800
    SQL> set serverout on
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := counter;
    10      counter := counter + 1;
    11    END LOOP;
    12    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    13    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    14  END;
    15  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Even smaller
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := 1;
    10    END LOOP;
    11    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    12    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    13  END;
    14  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Edited by: Saubhik on Jan 5, 2011 4:41 PM

  • Removing duplicate values from selectOneChoice bound to List Iterator

    I'm trying to remove duplicate values from a selectOneChoice that i have. The component binds back to a List Iterator on the pageDefinition.
    I have a table on a JSF page with 5 columns; the table is bound to a method iterator on the pageDef. Then above the table, there are 5 separate selectOneChoice components each one of which is bound to the result set of the table's iterator. So this means that each selectOneChoice only contains vales corresponding to the columns in the table which it represents.
    The selectOneChoice components are part of a search facility and allow the user to select values from them and restrict the results that are returned. The concept is fine and i works. However if i have repeating values in the selectOneChoice (which is inevitable given its bound to the table column result set), then i need to remove them. I can remove null values or empty strings using expression language in the rendered attribute as shown:
    <af:forEach var="item"
    items="#{bindings.XXXX.items}">
    <af:selectItem label="#{item.label}" value="#{item.label}"
    rendered="#{item.label != ''}"/>
    </af:forEach>
    But i dont know how i can remove duplicate values easily. I know i can programatically do it in a backing bean etc.... but i want to know if there is perhaps some EL that might do it or another setting that ADF gives which can overcome this.
    Any help would be appreciated.
    Kind Regards

    Hi,
    It'll be little difficult removing duplicates and keeping the context as it is with exixting standard functions. Removing duplicates irrespective of context changes, we can do with available functions. Please try with this UDF code which may help you...
    source>sort>UDF-->Target
    execution type of UDF is Allvalues of a context.
    public void UDF(String[] var1, ResultList result, Container container) throws StreamTransformationException{
    ArrayList aList = new ArrayList();
    aList.add(var1(0));
    result.addValue(var1(0));
    for(int i=1; i<var1.length; i++){
    if(aList.contains(var1(i)))
         continue;
    else{
    aList.add(var1(i));
    result.addValue(var1(i));
    Regards,
    Priyanka

Maybe you are looking for