Functions using nested

Hello Im trying to create a dynamic HTTP function which allows me to dynamically return any result in a table. In the code below within the nested function, Im inside the nested function I can gain access to the data, but outside of the nested function, the data is not returned. Could someone help me please? IM pulling my hair out here. See code below:

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"> "

< mx:Script >
<! [CDATA]
Import mx.rpc.http.mxml.HTTPService;
Import mx.collections.ArrayCollection;
Import mx.rpc.events.ResultEvent;

public void sendQuery(db:String,query:String):ArrayCollection
{
var returnData:ArrayCollection = new ArrayCollection collection;
var tmpArray:ArrayCollection = new ArrayCollection collection;

var obj:Object = new Object();
obj. Database DB;
obj. Query = query;

var httpService:HTTPService = new HTTPService;
httpService.method = "POST";
httpService.url = " " http://localhost/return_SQL.php ";
httpService.useProxy = false;
httpService.addEventListener (ResultEvent.RESULT, recieveData);
httpService.send (obj);

function recieveData(evt:ResultEvent):ArrayCollection
{
tmpArray = evt.result.data.graphdata;
Return tmpArray;
test. DataProvider = tmpArray ! ŒUVRES!
}
test.dataProvider = tmpArray; !!! DOES NOT WORK!

Return returnData;
}

public function testExer (): void
{
var myData:ArrayCollection = new ArrayCollection();
myData = sendQuery ('visa ',' SELECT * from redemption_data');
}

[]] >
< / mx:Script >

< mx:DataGrid = "214" x y = '112' id = 'test' >

< / mx:DataGrid >
< mx:Button = "233" x = "262" label = "Button" click = "testExer ()" / >

< / mx:Application >

You can't do that. Http service calls are asynchronous in Flex, which means that the result of the service will be unavailable at the time the function ends (because the function runs synchronously). You must use an asynchronous method (events, reminders, or even binding handlers).

Tags: Flex

Similar Questions

  • Functions of nested groups

    I thought that max (count ()) must be performed on separate groups of rows returned from GROUP BY deptno.
    However, it seems that count() is performed according to GROUP BY while max() is performed on the result of count()... GROUP BY.
    select max(count(deptno)) from emp group by deptno;
    Why is this? How does the nested group functions operate against the GROUP BY?

    PhoenixBai wrote:
    I thought that max (count ()) must be performed on separate groups of rows returned from GROUP BY deptno.
    However, it seems that count() is performed according to GROUP BY while max() is performed on the result of count()... GROUP BY.

    select max(count(deptno)) from emp group by deptno;
    

    Why is this? How does the nested group functions operate against the GROUP BY?

    Well, look at the statement. There is nothing more than a "condensed" to form:

    select max(cnt) from (select count(deptno) cnt from emp group by deptno)
    

    Everything said is calculate number in each group deptno and then calculate max of counties. Another word, what you call "nested" grouping always returns a single line. GROUP BY clause, if any, still applies to the internal group. External pool always implicitly uses GROUP BY and therefore query always returns a line even when the internal grouping produces no line. Grouping in same way THAT HAVING applies inside. In fact, you cannot specify HAVING for the external group:

    SQL> select max(sal) from emp group by deptno;
    
      MAX(SAL)
    ----------
          2850
          3000
          5000
    
    SQL> select max(max(sal)) from emp group by deptno having max(sal) = 3000;
    
    MAX(MAX(SAL))
    -------------
             3000
    
    SQL> select max(max(sal)) from emp group by deptno having (max(max(sal)) = 3000;
    select max(max(sal)) from emp group by deptno having (max(max(sal)) = 3000
                                                              *
    ERROR at line 1:
    ORA-00935: group function is nested too deeply
    
    SQL> -- You need to expand it
    
    SQL> select max(max_sal) from (select max(sal) max_sal from emp group by deptno) having max(max_sal) = 3000;
    
    no rows selected
    
    SQL> 
    

    SY.

  • Easy way to locate the function used on the diagram by name?

    Is there an easy way to locate the functions used in the diagram under the name of the generic function?

    I have user appears somewhat to the user on my diagram functions to help me debug a difficult sequence of agross events live multiple now that it works, I want to go back and disable most of these postings. Most of them went up to now within the layers a little structure and is not easy to find.

    So is there an easy way to get a list of where these functions are used so that I can quickly go and edit them?

    I find the function is with the display hierarchy that does just what I need.

    Thank you.

  • Can I call a function using the array index?

    I defined a table that stores the name of the function, like this:

    var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);

    Then I have a button named "btnresetTop" which, once clicked will be called one of the five functions stored in the array (aresetButtonTop) above. Functions are called at runtime depending on certain conditions. I need to figure out how I can call these functions using the array index. I use the following code to call the function. The value of i has already been calculated.


    btnresetTop.addEventListener (MouseEvent.CLICK, aresetButtonTop [i]);

    After doing this, I get the following error when I click on the button:

    TypeError: Error #2007: parameter listener must be non-null.
    at flash.events::EventDispatcher/addEventListener()
    at gallerytest_fla::MainTimeline/thumbTopClick()

    Note: thumbTopClick() is a function within which all these codes are written.

    I need to know if it is posible in AS3 to call a function name using array index or not. If so, could you afford ehelp me out.

    You can certainly do.

    In your case, it looks like i is out of range. Show your loop.

  • Can a DB function used between 2 pools of connections

    Hi all
    We have 2 pools of connections, 1 connected to Oracle DB Data Warehouse. The other connection pool is an Excel spreadsheet, which has projects and scheduling dates. We have modelled in MDB and her servant perfectly. Now, the question is, we have a function in Oracle DB, which works well when I use with any size of Oracle DB DW. But, when I use the same function using the dimension modeled of excel sheet it generates an error. Here, dimension sheet Excel is modeled to inculde model DW.

    Error: "A general error has occurred. [nQSError: 42015] Cannot function ship the following expression. »

    So my question is "is there no work around to use the same function when using the other connection pool size.

    Pointers for this problem is highly appreciated.

    Thank you
    Vijay

    Hi Vijay,

    I agree 100% with what Dave. The function you have in Oracle should have access to the values passed in. OBIEE has access to both DIM_DW and DIM_EXCEL, but the Oracle function has no access to DIM_EXCEL. Just to give you a high level understanding of what is happen, here's what OBIEE made to combine the two sets of data in a single report:

    Assume that your report is like so: DIM_DW. COLUMN1, DIM_EXCEL. COLUMN2, FACT_DW. MEASURE1

    To get the data OBIEE sends two separate applications: one against the DW that retrieves DIM_DW. Column1 and FACT_DW. MEASURE1 and another for DIM_EXCEL. COLUMN2.

    Once the two request to return, the OBIEE server joined data sets and then presents them in a report.

    Now, when you call your function (DIM_DW. COLUMN1, DIM_EXCEL. COLUMN2), OBIEE sends the request to just the Oracle DB. But the Oracle DB can not see the Excel data, then it fails because the DIM_EXCEL argument. Column2 is not defined to Oracle DB.

    Here are two methods you could use to make it work:
    (1) configure the Excel file as an external table in the Oracle DB. Then, the function would be aware of the values of column in Excel.
    (2) port the function to the MDB using layer logic the formula Expression. According to what is your function, it is not possible.

    Whatever it is, how you install now, you can't reach your goal. The reason why I recommended that you separate your connection pool Excel in a different database object is because the way you have it setup right now makes it appear like the Oracle DB would be aware of the Excel tables. But that's not true. Keeping them separated to avoid any future confusion.

    Good luck!

    -Joe

  • SQL with the Table using nested

    Hello

    Please help how to do that thing

    I have a nested table of object type

    create or replace type a1 as an object

    (

    a number,

    b varchar2 (30),

    VARCHAR2 (30) region

    );

    create table a1 type a1_array s;

    declare

    v_a1 a1;

    v_a1_array a1_array:=a1_array();

    Start

    v_a1 = a1 (1, '1', 'AUS');

    v_a1_array. EXTEND;

    v_a1_array (1): = v_a1;

    v_a1 = a1 (2, '2', 'AUS');

    v_a1_array. EXTEND;

    v_a1_array (2): = v_a1;

    v_a1 = a1 (3, '3', 'NAM');

    v_a1_array. EXTEND;

    v_a1_array (3): = v_a1;

    end;

    Now, I v_a1_array have 3 row 2 with region AUS and the other with NAM region.

    SQL help can I get lines only "AUS" and look in the TABLE OF TYPE v_a1_array (using Where clause and functions (Table))

    Any help will be much appreciated. Please help. I have Oracle 11g

    Thank you

    I hope that you are looking for this.

    pretend like your excel temp (with clause)

    v_a2 - is a type of a1_array

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    SQL > DROP TYPE a1_array;

    Type fell.

    SQL > DROP TYPE a1;

    Type fell.

    SQL > CREATE or REPLACE TYPE a1 AS OBJECT
    2 (a NUMBER, b VARCHAR2 (30), region VARCHAR2 (30));
    3.

    Type of creation.

    SQL > CREATE TYPE a1_array IS TABLE of a1;
    2.

    Type of creation.

    SQL > DECLARE
    v_a1 2 a1_array;
    3 v_a2 a1_array;
    4 BEGIN
    5 WITH temp
    6 AS (SELECT 1 a, 1 b, "AUS" AS region FROM DUAL
    7 UNION ALL
    8. SELECT 2 AS a, 2 b, "AUS" AS region FROM DUAL
    9 UNION ALL
    10. SELECT 3 a, b '3', 'NAM' AS region OF DOUBLE)
    11. SELECT a1 (x.a, x.b, x.region)
    In BULK 12 COLLECT IN v_a1
    Temp 13 x;
    14
    15 SELECT a1 (x.a, x.b, x.region)
    In BULK 16 COLLECT IN v_a2
    TABLE (v_a1) 17 x
    18 WHERE x.region = 'NAM ';
    19
    20
    21 FOR I IN 1... v_a2. COUNTY
    22 LOOP
    (23) DBMS_OUTPUT.put_line
    24 v_a2 (i) .a | '-' || v_a2 (i) .b | '-' || v_a2 (i) .region);
    25 END OF LOOP;
    26 END;
    27.
    3-3-NAM

    PL/SQL procedure successfully completed.

    SQL > spool off;

  • Properties of the object using nested in the dataField DataGrid

    I fill a DataGrid with an ArrayCollection of objects collection. Each of these objects has a property that is itself an object. I want to use a property of the object of the second (or "nested") as a dataField for one of my articles.

    No idea how to make this work? A rendering custom element would be the only way?

    ~ dimival:

    Thanks for the reminder. I use point made almost exclusively, so I forgot about the functions of label. I was able to make it work like this:

  • How can I create a function using variables TestStand and call from Meadow step Expression?

    In one sequence, I have dozens of prior Expressions, which are almost the same thing, like this...

    Locals.tagID = (Parameters.singlePhaseEnabled? ('L': "D") & Str (Locals.phase) & "006".

    .. and the only thing different is this three-digit string in the end ("006" may vary). How can I write a function that I can call from Meadow step Expression then it should look like this? ...

    Locals.tagID = MyNewFunction("006")

    You can not write custom expressions for commands.

    That being said, there are two options:

    • Create a sous-suite with a single step. Use a setting of the sequence as "function parameter.

    • Create a step type custom including a lower level module that implements the function. Add a step edit to allow the user to the steptype graciously change the setting.

    • Store the variable setting in a local global variable / file and change the value in each step. This will, at least, keep the same 'function' for each step.

    Norbert

  • using nest if then statements using ABM

    I have a two input, 1 output circuit, as in the attached schema. My third node is set down by the very high resistance voltmeter. What I have is a user defined current source ABM that depends on other parameters in the circuit. I wonder it is what my conditional statement is entered in the right format? Conditions are particularly complex and describe as follows:

    If the voltage difference between V2 and U1 is greater than 0, then the current in the ABM = 10 ^-12

    If this voltage difference that the above is not greater than zero and if (V (1) u (1))<(V(2)-U(1)), then="" the="" abm="" current="" is="">

    Otherwise, if (V (1) u (1)) > = (V (2) u (1)) then the current is (0.1*((-(V(2)-U(1)))^0.35))*0.00001596*(((V(2)-U(1))^2)/2)

    As you can see, they are very complex conditions and my concern is that I can't just type in U1 and get the compiler to understand I want the voltage read on the voltmeter of bottom-node. I think I'm using the correct nesting in the encoding format is: if (T, X, (if(Q,R,S))).

    Any help would be appreciated, and details can be provided.

    I don't know why its not throwing an error for the use of u (1), maybe it's a valid keyword.

    If you want to reference a voltage properly, it should be V (net_name) for single ended voltages (referenced to ground) or V (net1, net2) for differential voltages... For models ABM I suggest turning on net visibility throughout the schematic so that you know the net name to the positive terminal of U1 or anywhere else for that matter.

    I think the syntax you have to if/then/else is correct otherwise.

    Kind regards
    Pat Noonan
    National Instruments

  • How s/n know when and what account perform a function using the database link?

    Dear,

    My application of the CIM team asked DBA to create new function and run it. Function must use the database link for remote database data. So I need to create a new database to their licensing link. Cause we guess we'll experience the performance issue after the user performs this function, or another question and errors may occur. So we want to know when and who use this feature that connects to a remote database through the new database connection in advance. And I also need to know when and which connect to the remote database using this new database link. We have no idea to get this information?  Can anyone recommend how do? Thank you very much.

    Best reqards, Otis.

    Check what business purpose, it will solve.  If the function is so safe, why everyone will use. Only admin people should access.

    All of these additional controls of this kind must be avoided as much as possible to improve the overall performance of the application.

    Still if you need, see the database audit mechanism, specifically designed for this type of activity.

    Kind regards

    Harman

  • Create/edit functionality using popup

    Hello

    I do face-down question on one Page ADF:

    I have read only the ADF. Under the table, there are 3 buttons (Edit current line, create new & Commit).
    The two edit/create button opens a popup window showing the ADF form for the selected line in the case of edit and new blank line while creating new. From there I can make changes, and then use save or cancel button to return to the home page. The table of automatically refreshes with the new changes if I press the button Save on popup. If I press the Cancel button, there is no change in the table on the home page. The edit functionality works very well.

    However, if is created, the table shows newly created line even if I click on Cancel button on the pop-up window. The table should show the new line only if I select Save button on the pop-up window.

    I use 2 BTF for this. (Control data)
    BTF 1:
    MainPG (edit)-> EditBTF
    MainPG (create)-> createInsert()-> EditBTF

    2ND BTF:
    EditPG (Economics)-> back
    EditPG (cancel)-> back (restore save point = TRUE)

    Sushant-

    Why the question comes only in the case of create new ones?

    Because when you cancel popup, the values are not subject, but when you create new rank (CreateInsert) this is automatically applied.

    Also, the second part of your post, I noticed that you use BTF to add/change features in order to check these links:

    GEBS | Oracle ADF creating an add/edit defined workflow (using a new transaction)

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/007-cancelform-savepoint-169126.PDF

    Dario

  • Error using nested for each activity group transform Oracle SOA 11 g

    I posted this problem in XML general forum section. I don't know if it was in the right place because the error occurs in a BPEL.

    Thank you for taking the time to post this thread.
    I created a XSLT transformation that runs on oxygen, but does not work in a SOA transformation activity.

    Given this XML-

    < country >
    < info enum = "CTRY" name = 'United States' States-total = "50" / >
    < enum = 'ST' index info = '0' sname = "New York" population = "8 244 910" / >
    < enum = 'ST' index info = '0' sname = "Chicago" population = "2 707 120" / >
    < info enum = "CTRY" name = 'Germany' States-total = "16" / >
    < enum = 'ST' index info = '1' sname = population "Berlin" = "3 469 910" / >
    < enum = 'ST' index info = '1' sname = population "Brandenburg" = "2 500 000" / >
    < / country >

    Work of XSLT in the oxygen-

    < xsl: template match = "/" >
    < country >
    [< xsl: for each group-select = "" countries / * ' group-starting-with="info[@enum='CTRY"] ">"
    < CountryInfo >
    < xsl: Call-template name = "ctry" / >
    < / CountryInfo >
    < / xsl: for each group->
    < / country >
    < / xsl: template >

    < xsl: template name = "ctry" >
    < name > country: < xsl: value-of select="@name"/ > < / name >
    districts of <>< xsl: value-of select="@total-states"/ > < / districts >
    < xsl: for each group-select = "current - group ()" group-by="@index" >
    < xsl: Call-template name = "States" / >
    < / xsl: for each group->
    < / xsl: template >

    < xsl: template name = "States" >
    < name of xsl: variable = "index" select="@index"/ >
    States <>
    < xsl: for each select = "current - group ()" >
    < name >
    < xsl: value-of select="@sname"/ >
    < / name >
    < / xsl: foreach >
    < / states >
    < / xsl: template >

    I get the desired oxygen - result

    < country >
    < CountryInfo >
    < name > country: United States of America < / name >
    < > 50 districts < / districts >
    States <>
    < name > New York < / name >
    < name > Chicago < / name >
    < / states >
    < / CountryInfo >
    < CountryInfo >
    < name > country: Germany < / name >
    < > 16 districts < / districts >
    States <>
    < name > Berlin < / name >
    Brandenburg < name > < / name >
    < / states >
    < / CountryInfo >
    < / country >

    In a transformation of Oracle, I get an error "cannot perform XPath expression. I have narrowed down the cause of the error. The error is caused by
    the nested for each group - using 'current - group ()' and 'group-by=@index '.

    < xsl: for each group-select = "current - group ()" group-by="@index" >
    < xsl: Call-template name = "States" / >
    < / xsl: for each group->

    Oracle does not throw an error if I use ' Country/info' instead of ' current - group () or group-starting-with, but this does not produce the desired result.
    because he needs to be grouped by "@index."

    Does anyone know why the Oracle processing activity is not able to use the nested < xsl: for each group-select = "current - group ()" group-by="@index" >?

    This error has been fixed by modifying .

    It seems that the XSLT for Oracle parser does not correctly XSLT 2.0. This is understandable since in 11g does not have full support for XSLT 2.0.

  • Error using nested for each group - in Oracle XSLT

    Hello everyone. Thank you for taking the time to post this thread.
    I created a XSLT transformation that runs on oxygen, but does not work in Oracle.

    Given this XML-

    < country >
    < info enum = "CTRY" name = 'United States' States-total = "50" / >
    < enum = 'ST' index info = '0' sname = "New York" population = "8 244 910" / >
    < enum = 'ST' index info = '0' sname = "Chicago" population = "2 707 120" / >
    < info enum = "CTRY" name = 'Germany' States-total = "16" / >
    < enum = 'ST' index info = '1' sname = population "Berlin" = "3 469 910" / >
    < enum = 'ST' index info = '1' sname = population "Brandenburg" = "2 500 000" / >
    < / country >

    Work of XSLT in the oxygen-

    < xsl: template match = "/" >
    < country >
    [< xsl: for each group-select = "" countries / * ' group-starting-with="info[@enum='CTRY"] ">"
    < CountryInfo >
    < xsl: Call-template name = "ctry" / >
    < / CountryInfo >
    < / xsl: for each group->
    < / country >
    < / xsl: template >

    < xsl: template name = "ctry" >
    < name > country: < xsl: value-of select="@name"/ > < / name >
    districts of <>< xsl: value-of select="@total-states"/ > < / districts >
    < xsl: for each group-select = "current - group ()" group-by="@index" >
    < xsl: Call-template name = "States" / >
    < / xsl: for each group->
    < / xsl: template >

    < xsl: template name = "States" >
    < name of xsl: variable = "index" select="@index"/ >
    States <>
    < xsl: for each select = "current - group ()" >
    < name >
    < xsl: value-of select="@sname"/ >
    < / name >
    < / xsl: foreach >
    < / states >
    < / xsl: template >

    I get the desired oxygen - result

    < country >
    < CountryInfo >
    < name > country: United States of America < / name >
    < > 50 districts < / districts >
    States <>
    < name > New York < / name >
    < name > Chicago < / name >
    < / states >
    < / CountryInfo >
    < CountryInfo >
    < name > country: Germany < / name >
    < > 16 districts < / districts >
    States <>
    < name > Berlin < / name >
    Brandenburg < name > < / name >
    < / states >
    < / CountryInfo >
    < / country >

    In a transformation of Oracle, I get an error "cannot perform XPath expression. I have narrowed down the cause of the error. The error is caused by
    the nested for each group - using 'current - group ().'

    < xsl: for each group-select = "current - group ()" group-by="@index" >
    < xsl: Call-template name = "States" / >
    < / xsl: for each group->

    Oracle does not throw an error if I use ' Country/info' instead of 'current - group ()', but this does not produce the desired result
    because he needs to be grouped by "@index."

    Does anyone know why my XSLT does not work in a transformation from Oracle?

    oracleistheway wrote:
    Does anyone know why my XSLT does not work in a transformation from Oracle?

    What do you mean by "transform Oracle?

    If you are referring to the integrated database XSLT processor available through XMLTransform or DBMS_XSLProcessor API, it does not support XSLT 2.0, 1.0 only.

    If you use the XDK Java (oracle.xml.parser.v2) Please give the exact version.

  • Close() in function using ScriptUI.

    Guys, I created an interface with ScriptUI only has a IconButton within a group, which in turn is located in another group. I also created a listener to see who you press on " on the keyboard, which performs a function where there is a condition that must close the interface If the key is pressed " "" Enter. " However there is a error on line # 23, I am unable to define the correct path ... I'm not even embarrassed ask, but I'm more than an hour by train and I can't not solve this problem. Le onClick event online # ' 12 runs correctly so groups using the " ""parent", but how do I need to walk the line like # 23?


    Thank you very

    //
    dialogo();
    function dialogo(){
                var janela = new Window ("dialog");
                //     
                            var grupoDaDireita = janela.add ("group");
                            //
                                        var grupo4Dir = grupoDaDireita.add ("group");
                                        //
                                        var btnOK = File (Folder(File($.fileName).parent).fullName+"/"+"ok_btn.png")
                                        var eventoOk = grupo4Dir.add ("iconbutton", undefined, btnOK, {style: "toolbutton"});
                                        eventoOk.onClick = function (){this.parent.parent.parent.close();};
                                        //
                            //
                //
                janela.addEventListener ("keydown", function (k) {verificaKeyboard(k);});
                janela.show ();
    }
    //
    function verificaKeyboard(k){
                alert(k.keyName);
                if(k.keyName == "Enter"){
                            janela.close();
                }
    }
    //
    

    Hello

    Move your verificaKeyboard() function in the body of the dialogo() function

    variable "Alana" is local and is not accessible.

    Jarek

  • Why the hell use nested tables?

    Hello
    I'm boning up on top of the PL/SQL (again) waiting to get a new job.
    I have several years of experience in various roles related to the data, including many used Oracle.
    On the issue of collections, I ask myself, in light of my experience, to find and not for the first time, why the hell would anyone want to do this:

    create or replace type TEST_TT as table of varchar2(10);
    /
    
    create table TEST_TABLE ( X number
                             ,Y test_tt) 
                             nested table Y store as Y_TABLE;                      
    I really, really, can't think why we want to store data like that. It seems unnecessarily complex, hiding a one-to-many relationship inside TEST_TABLE, which should rather be modeled and implemented as a separate table.
    In addition, there are a lot of tutorials on the collections that tell us how to do the above (in fact I read Feuerstein right now), but nobody seems to tell us WHY we should do it.

    Can someone help me out here?

    Thank you.
    Jason

    I can't imagine wanting to create a table like this one either (or, if this can help, can Tom Kyte).

    The collections are terribly useful in PL/SQL, when they help you avoid one treatment per line. I can't imagine wanting to integrate into my data model. Frankly, it's much the same with the types of objects - they are quite useful in PL/SQL, but I would never want to create a table in my data model that contained an object.

    Justin

Maybe you are looking for