nested for loop in the collection

Hi Experts,

Collection1

============

SELECT o.object_id

LOOSE COLLECTION l_obj_info

FROM (SELECT n.node_id, n.object_id

N nodes

START WITH n.node_id = 100

N.node_id CONNECT BY PRIOR = n.parent_node_id) n

JOIN IN-HOUSE

objects o ON o.object_id = n.object_id

WHERE o.object_type_id = 285;

s Collection2

============

SELECT *.

LOOSE COLLECTION l_tab

OF ((SELECT REGEXP_SUBSTR (i_l_text, "[^,] +', 1, NIVEAU)))

OF THE DOUBLE

CONNECT BY REGEXP_SUBSTR (i_l_text, "[^,] +', 1, LEVEL") IS NOT NULL));

END;

collection3

============

SELECT o.object_id

LOOSE COLLECTION l_fin_tab

Of objects o JOIN ATTRIBUTES att

ON o.object_id = att.object_id

WHERE o.object_id = collection1.object_id

- AND att. VALUE = collection2.val;

Please tell me how to implement for loop in the collection3 to get the values of collection1 and s collection2.

I tried in the way below

CREATE or REPLACE TYPE LIST_OF_ATTRIBUTES_TYPE AS TABLE OF THE varchar2 (4000);

/

CREATE or REPLACE TYPE LIST_OF_OBJECT_IDS_TYPE AS TABLE OF THE number (9);

/

(F_get_objects_by_type_id) CREATE or REPLACE FUNCTION

i_object_type_id in NUMBERS

i_l_text IN VARCHAR2,

i_scope_node_id NUMBER

)

RETURN list_of_object_ids_type

AS

CURSOR objs_info

IS

SELECT o.object_id

FROM (SELECT n.node_id, n.object_id

N nodes

START WITH n.node_id = i_scope_node_id

N.node_id CONNECT BY PRIOR = n.parent_node_id) n

JOIN IN-HOUSE

objects o ON o.object_id = n.object_id

WHERE o.object_type_id = i_object_type_id;

l_tab list_of_attributes_type: = list_of_attributes_type ();

-l_obj_info list_of_object_ids_type: = list_of_object_ids_type ();

l_fin_tab list_of_object_ids_type: = list_of_object_ids_type ();

BEGIN

BEGIN

SELECT *.

LOOSE COLLECTION l_tab

OF ((SELECT trREGEXP_SUBSTR (i_l_text, "[^,] +', 1, NIVEAU)))

OF THE DOUBLE

CONNECT BY REGEXP_SUBSTR (i_l_text, "[^,] +', 1, LEVEL") IS NOT NULL));

END;

IF l_tab. COUNT > 0

THEN

BECAUSE me IN objs_info

LOOP

FOR j IN l_tab. FIRST... l_tab. LAST

LOOP

SELECT o.object_id

LOOSE COLLECTION l_fin_tab

O JOIN ATTRIBUTES att OBJECTS ON o.object_id =

att.object_id

WHERE

att. VALUE = l_tab (j) and o.object_id = objs_info (i);

END LOOP;

END LOOP;

END IF;

RETURN l_fin_tab;

END f_get_objects_by_type_id;

/

What this different problem from that of pls 00382 expression is incorrect, as they were returning a record type ?

Please do not raise the same question several times. The answer is always the same. Your data model is seriously wrong - and that's the reason why you can't get data from it.

Tags: Database

Similar Questions

  • Creating tables in a nested for loop

    Hi all.

    I was stuck in this problem for quite a while now and I still don't know how to continue. Some outside the entrance would be greatly appreciated!

    I'm doing the following:

    -Take an array of numbers, to check if they are within a certain range (e.g. between 2 and 4)

    -Build two new arrays: one with all the numbers that are inside the beach and the other with the rest.

    An additional condition is that the amount and value of the range conditions will change (for example, it could be between 2 and 4 only / 2, 4 AND 6 and 7 according to the entry)

    To treat this, I created two nested for loops - one that goes on a table that contains conditions of the beach and inside that actually go and check if the values are in the range. I think I did that part successfully, but the next part is confusing to me - how to actually create the tables separated within two loops for?

    My apologies if I did not explain it well. Another method to support this problem is I want to translate following LabVIEW:

    Ranges of table / / [1 5 7 10] exodus-> This means we want to divide numbers based on those who are in (1,2) and (4.5) against those who are not

    Table of values / / [2 3 6 11 3]

    EndOperationDelegate table / / array of values within the range
    Table outValues / / Array of values out of range

    for m = 1:size (ranges)

    for n = 1:size (values)
    If (THE NUMBER IS on the INSIDE of EACH RANGE)
    EndOperationDelegate = [EndOperationDelegate NEWNUMBER]
    on the other
    outValues = [outValues NEWNUMBER]
    end

    end
    end

    Sounds easy enough, but it gets so chaotic with Labview that I don't know what to do. I have attached a reference image - insertion in the array function is not in fact add to the table, it creates a new table. How can I save that for when the nested for the ends of the loop?

    I have seen a few examples with shift registers which lie in a loop and I couldn't successfully that transfers in my block diagram.

    Any help/direction would be greatly appreciated.

    Hello!

    See the following example to understand how you can create a table in the loop For

    In your case, you also can uce conditional terminal to create a table only when then located nearby. It makes the code much cleaner that the structures of the case

    Hope this helps, if not, let me know if I can help you!

    Marcin

  • Capture of sequences of images - issues with nested for loops

    Hi all

    I've written a vi. to capture a number of images ("Image") and save these images, sent to a folder of my choice.  Each image is identified sequentially.  However, I would like to make a number of iterations ("run") of this capture sequence, such that each image file name would be "Filename (Run) _(Image_No).png", for example run 5, image 10 'Filename 5_10.png.  I tried a nested for loop for this but I have an error message 'Current asynchronous i/o Operation' (I have attached a printscreen).

    Can someone help me solve this problem?  Please find attached my vi.

    Sincere greetings and thanks,

    Miika

    Hi toto26,.

    Thank you for your response.  I solved the problem by using a sequence structure flat - file in the first image and all the treatment in the second.

    Kind regards

    Miika

  • When to use the cursor for loop and the cursor (open, fetch, close)

    Hello world
    I have a small doubt about when to use the cursor for loop and when to use the cursor for loop and the cursor (open, fetch, close).
    Well, I'm not the difference between implicit and explicit cursor. So please tell me how I got to know, what to use and when?




    Kind regards
    BS2012

    Published by: BS2012 on January 29, 2013 12:15

    All SQLs are analyzed, stored and executed as cursors. Thus, you will always use a cursor.

    The problem is that languages, such as PL/SQL, provide different interfaces to interact with the SQL cursor. As the ref, the slider interface, the interface DBMS_SQL slider interface and so on.

    Each of these interfaces offers different features. For example, using the interface DBMS_SQL allows binding dynamics and dynamic recovery. The Ref Cursor interface allows your code PL/SQL pass a handle to a reference pointing to the SQL cursor, to an external client. Etc.

    The fundamental reason for the use of an explicit cursor interface is mainly that you own and manage bulk made extraction output provided by PL/SQL cursor.

    With a cursor FOR , the motor loop of PL/SQL optimize the loop by extracting block a 100 lines both. However, you cannot access this collection in bulk directly inside the loop.

    With an explicit cursor interface, you specify the size of the extraction in bulk via the clause LIMIT , and you set the variable of collection to use. This allows you to use the collection directly variable inside the loop.

    However, the need to do - code manually in bulk collection - rarely occur in the daily programs in PL/SQL. A line of treatment is both slow and not well fits. And even if your bulk code collects lines, these lines must still be processed one at a time in your code. It is much more efficient and scalable rather write SQL code, and make the engine SQL the line of treatment for you.

  • Nested for loops error

    Hi all members of the community, I am experiencing problem with pulling the attributes of an xml I created. I use nested for loop. Please kindly help me to solve this problem...

    Thanks in advance...

    Here's the code & xml...


    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events. *;
    flash.net import. *;

    var myXML:XML;

    var voiceOver: String;
    var startOffset:Number;
    var slideData:Array;
    var id_cont_array:Array = new Array();
    var id_textfield_array:Array = new Array();
    var id_image_array:Array = new Array();

    var myXML_Container_Length:Number;
    var myXML_textField_Length:Number;
    var myXML_images_Length:Number;

    var loader: URLLoader = new URLLoader();
    Loader.Load (new URLRequest ("dynamic.xml"));

    loader.addEventListener (Event.COMPLETE, processXML);

    function processXML(e:Event):void
    {
    slideData = new Array();
    myXML = new XML (loader.data);

    loader.removeEventListener (Event.COMPLETE, processXML);
    loader.removeEventListener (IOErrorEvent.IO_ERROR, loadError);

    myXML = new XML (e.target.data);
    voice-over = myXML. @ voice_over;
    startOffset = myXML. @ start_offset;

    for (var i: uint = 0; i < myXML.*.length (); i ++)
    {
    trace (myXML + 'slide');
    }


    myXML_List = myXML.children ();
    myXML_Container_Length = myXML.children () .length ();
    trace (myXML_Container_Length + "is myXML_Container_Length")
    myXML_textField_Length = myXML.containerss [0] .children () .length ();
    myXML_images_Length = myXML.children () .length ();
    trace (myXML.Child ("containerss") [3]. @ id.toXMLString () + "== myXML.containerss [0].") @ id; ») ;
    trace (.textfield myXML.containerss [0] [0]. @ id + "== myXML.slide.containerss [0].") ("@ id");
    trace (myXML.containerss [0] .textfield [1]. @ id + "== myXML.slide.containerss [1].") ("@ id");
    trace (myXML.containerss [3] [0] image. @ id + "is image [0]");
    trace(myXML.containerss[0].) Children() + "== myXML.containerss [0] .children ()"); "."

    for (var j: Number = 0; j < = myXML_Container_Length; j ++)
    {
    id_cont_array.push (myXML.containerss [j]. @ id);
    trace (myXML.containerss [j]. Children () .length () + 'is j');
    myXML_textField_Length = myXML.containerss [j] .children () .length ();
    trace (myXML_textField_Length + "is myXML_textField_Length");
    for (var k: Number = 0; k < = myXML_textField_Length-1; k ++)
    {

    id_textfield_array.push (.textfield myXML.containerss [j] [k]. @ id);
    id_image_array.push (image of [k] myXML.containerss [j]. @ id);
    trace (id_textfield_array [k] + "== id_textfield_array [k] ==" + k + "--j ==" + j);
    trace ("== id_image_array" + id_image_array [k]);
    }
    trace(id_textfield_array[j]+"==id_cont_array[j]");
    }

    trace (myXML_List.length () + "= myXML_List");

    }

    function loadError(e:IOErrorEvent):void
    {

    trace ("loadError");
    }

    XML is as below...

    < drag direction = "VERTICAL" voice_over = "Slide1.mp3" start_offset = "0" margin ="" > "

    < set id = "0" direction = "HORIZONTAL" padding = "10" margin = "10" x = "10" y = "160" width = "200" height = "150" >
    < textfield id = "Text1" text = "textfieldText1" padding = "10" margin = "10" x = "10" y = "160" / >
    < image id = "img1" text = "" padding = "10" margin = "10" x = "10" y = "160" / > "
    < textfield id = "Text2" text = "textfieldText2" padding = "10" margin = "10" x = "10" y = "160" / >
    < / define >
    < set id = "1" orientation = "HORIZONTAL" padding = "10" margin = "10" width = "200" height = "200" x = "10" y = "160" >
    < textfield id = "Text3" text = "textfieldText3" padding = "10" margin = "10" x = "10" y = "160" / >
    < image id = "img2" text = "" padding = "10" margin = "10" x = "10" y = "160" / > "

    < / define >
    < set id = "2" orientation = "VERTICAL" padding = "10" margin = "10" width = "200" height = "150" x = "10" y = "160" >
    < textfield id = "Rem5" text = "textfieldText5" padding = "10" margin = "10" width = "200" height = "150" x = "10" y = "160" / >
    < image id = "img3" text = "" padding = "10" margin = "10" x = "10" y = "160" / > "
    < textfield id = 'Text6"text ="textfieldText6"padding ="10"margin ="10"x ="10"y ="160"/ >
    < / define >
    < set id = "4" orientation = "VERTICAL" padding = "10" margin = "10" width = "200" height = "150" x = "10" y = "160" >
    < textfield id = 'Text7"text ="textfieldText7"padding ="10"margin ="10"width ="200"height ="150"x ="10"y ="160"/ >
    < image id = "img4" text = "" padding = "10" margin = "10" x = "10" y = "160" / > "
    < textfield id = "Texte8" text = "textfieldText8" padding = "10" margin = "10" width = "200" height = "150" x = "10" y = "160" / >
    < / define >
    < / slide >

    The analysis is totally false. You operate processXML() should be like this:

    function processXML(e:Event):void
    {
              slideData = new Array();
              loader.removeEventListener(Event.COMPLETE, processXML);
              loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
              myXML = new XML(e.target.data);
              voiceOver = myXML.@voice_over;
              startOffset = myXML.@start_offset;
              myXML_Container_Length = myXML.children().length();
              var node:XMLList;
              for (var j:Number = 0; j <= myXML_Container_Length - 1; j++)
              {
                        id_cont_array.push(myXML.containerss[j].@id);
                        node = myXML.containerss[j].children();
                        myXML_textField_Length = node.length();
                        for (var k:Number = 0; k <= myXML_textField_Length - 1; k++)
                        {
                                  switch (node[k].name().toString())
                                  {
                                            case "textfield":
                                                      trace(node[k].@id);
                                                      id_textfield_array.push(node[k].@id);
                                                      break;
    
                                            case "image":
                                                      id_image_array.push(node.@id);
                                                      break;
                                  }
                        }
              }
    }
    
  • For loops with the cursor line and indexing

    Hi all

    I have a question about the loops with the cursor, line and indexing.

    How can I scan via a cursor with an iterator?

    I would use an iterator as

    Whole LoopIndex;
    Whole LoopIndex2;

    for LoopIndex at the beginning of the cursor at the end of the cursor
    loop
    line =: cursor [LoopIndex];
    for LoopIndex2 of LoopIndex at the end of the cursor
    etc...
    end loop;

    I need to use an iterator because I need to use a nested for loop.



    OR


    How can I solve the following problem?

    Class name % ofClass average test Score
    1 Niobe 7 8 8.4
    1 alena 4 7 7.5
    1 9 7 8.9 Estia
    1 Lilly 10 8 9.8
    1 Sandra 6 8 8.3
    1 Melanie 8 8 8.1
    Nadia 2 8 3 4.4
    Sayuki 2 9 8 8.4
    Diasy 2 7 8 8.0
    Flower 2 7 8 6.5
    Diana 2 6 8 7.3
    3 Flora 7 8 5.8
    Sukiya 3 4 8 8.4
    Samantha 3 10 8 7.7
    Roxanne 3 7 8 6.9
    Eline 3 8 8 7.4

    I need to
    -By class, I need to recalculate each average people
    -By class, I need to calculate the % of class score (sum averages / people in the class)

    So it can be done in a nested for loop?
    Or do I just step by step?

    Well, based on this information it would be something like...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 1 as Class, 'Niobe' as Nm, 7 as Score, 8 as Tests, 8.4 as Average from dual union all
      2             select 1, 'Alena', 4, 7, 7.5 from dual union all
      3             select 1, 'Estia', 9, 7, 8.9 from dual union all
      4             select 1, 'Lilly', 10, 8, 9.8 from dual union all
      5             select 1, 'Sandra', 6, 8, 8.3 from dual union all
      6             select 1, 'Melanie', 8, 8, 8.1 from dual union all
      7             select 2, 'Nadia', 3, 8, 4.4 from dual union all
      8             select 2, 'Sayuki', 9, 8, 8.4 from dual union all
      9             select 2, 'Diasy', 7, 8, 8.0 from dual union all
     10             select 2, 'Blossom', 7, 8, 6.5 from dual union all
     11             select 2, 'Diana', 6, 8, 7.3 from dual union all
     12             select 3, 'Flora', 7, 8, 5.8 from dual union all
     13             select 3, 'Sukiya', 4, 8, 8.4 from dual union all
     14             select 3, 'Samantha', 10, 8, 7.7 from dual union all
     15             select 3, 'Roxanne', 7, 8, 6.9 from dual union all
     16             select 3, 'Eline', 8, 8, 7.4 from dual)
     17  --
     18  -- END OF TEST DATA
     19  --
     20  select class, nm as "NAME", score, tests, average
     21        ,round(((average*tests)+score)/(tests+1),1) as avg_person
     22        ,round((average / sum(average) over (partition by class))*100,1) as class_average
     23  from t
     24* order by class, nm
    SQL> /
    
         CLASS NAME          SCORE      TESTS    AVERAGE AVG_PERSON CLASS_AVERAGE
    ---------- -------- ---------- ---------- ---------- ---------- -------------
             1 Alena             4          7        7.5        7.1          14.7
             1 Estia             9          7        8.9        8.9          17.5
             1 Lilly            10          8        9.8        9.8          19.2
             1 Melanie           8          8        8.1        8.1          15.9
             1 Niobe             7          8        8.4        8.2          16.5
             1 Sandra            6          8        8.3          8          16.3
             2 Blossom           7          8        6.5        6.6          18.8
             2 Diana             6          8        7.3        7.2          21.1
             2 Diasy             7          8          8        7.9          23.1
             2 Nadia             3          8        4.4        4.2          12.7
             2 Sayuki            9          8        8.4        8.5          24.3
             3 Eline             8          8        7.4        7.5          20.4
             3 Flora             7          8        5.8        5.9            16
             3 Roxanne           7          8        6.9        6.9          19.1
             3 Samantha         10          8        7.7          8          21.3
             3 Sukiya            4          8        8.4        7.9          23.2
    
    16 rows selected.
    
  • Nested for loops EACH in the XML editor

    I have a xml like this.

    <?xml version="1.0" encoding="UTF-8"?>
    <DATA_DS>
         <Line_Approver>
              <getLineNumberAssigneesResponse>
              <result>
                    <LineNumber>1</LineNumber>
                    <Assignees>One</Assignees>
               </result>
              <results>
    
                   <LineNumber>2</LineNumber>
                   <Assignees>Two</Assignees>
              </result>
    
              </getLineNumberAssigneesResponse>
         </Line_Approver>
    <DATA_DS>
         <HEADER>
         <INVOICE_ID>300100071480733</INVOICE_ID>
         <AMOUNT>1111</AMOUNT>
         <INVOICE_CURRENCY_CODE>USD</INVOICE_CURRENCY_CODE>
         <INVOICE_NUM>100</INVOICE_NUM>
         <INVOICE_DATE>2015-11-13T00:00:00.000+05:30</INVOICE_DATE>
         <PAYMENT_CURRENCY_CODE>USD</PAYMENT_CURRENCY_CODE>
         <ORG_ID>204</ORG_ID>
         
         <INVOICELINES>
                  <LINE_NUMBER>1</LINE_NUMBER><LINE_TYPE>Item</LINE_TYPE><AMOUNT>1000</AMOUNT><INVOICE_ID>zzz</INVOICE_ID><EXPENDITURE_ITEM_DATE></EXPENDITURE_ITEM_DATE>
         </INVOICELINES>
         <INVOICELINES>
              <LINE_NUMBER>2</LINE_NUMBER><LINE_TYPE>Item</LINE_TYPE><AMOUNT>111</AMOUNT><INVOICE_ID>300100071480733</INVOICE_ID><EXPENDITURE_ITEM_DATE></EXPENDITURE_ITEM_DATE>
         </INVOICELINES>
         </HEADER>
    
    <some more xml/>
    </DATA_DS>
    
    </DATA_DS>
    

    As you can see there are two results and and two invoice lines.

    I want to create a table of invoice lines for which the line number is present in the result.

    So my psudo code is as follows

    for each in result:
         assign result.linenumber to variable
         for each in InvoiceLines:
              compare the InvoiceLines.Line_number to variable:
                   if match print row.
    

    I know I won't have access to the LineNumber result with in second forloop because of the determination of the lexical scope.

    Far from assignment, I am unable to get the value of the number of the line itself.

    I tried two methods of application for with in what work force. The underside of work that uses the absolute path.

    What xpath Miss. Can I do better?

    FOR1: <?for-each:/DATA_DS/Line_Approver/getLineNumberAssigneesResponse/result?>
    
    FOR2: <?for-each:/DATA_DS/DATA_DS/HEADER/INVOICELINES?>
    

    LINE_NUMBER

    LINE_TYPE

    AMOUNT

    For 1 <? LineNumber? > 2 LINE_NUMBER

    LINE_TYPE

    AMOUNT ENDFOR1 ENDFOR2

    I think I gave enough information. Answer just in case I did not say anything clearly.

    You can do this via a simple foreach loop and the code would be

    Please see the data XML and RTF attached for your reference.

    I changed the data in XML format (I added 10 instead of 1) just to make sure that its works or not, and it works very well.

  • How to move the Cursor parameter for loop with the type of table?

    Hi friends,
    I wonder how to pass a parameter into the second loop in the code example below. Please see the "BOLD" statements and to answer my questions.
    Thank you very much. Here's the code.

    declare
    l_bom_header_tbl BOM_BO_PUB. BOM_HEADER_TBL_TYPE; -TABLE TYPE
    V_bom_header_tbl Bom_Bo_Pub.Bom_Head_Rec_Type: = Bom_Bo_Pub.G_MISS_BOM_HEADER_REC; -Record type
    v_bom_components_tbl Bom_Bo_Pub.Bom_Comps_Tbl_Type: = Bom_Bo_Pub.G_MISS_BOM_COMPONENT_TBL; - nested table type
    c: number = 0;
    k: = 1 number;
    Start
    BOMPXINQ. () Export_BOM
    P_org_hierarchy_name = > l_org_hierarchy_name,
    P_assembly_item_name = > l_assembly_item_name,
    P_organization_code = > l_organization_code,
    P_alternate_bm_designator = > '1Test. "
    P_Costs = > l_costs,
    P_Cost_type_id = > l_cost_type_id,
    X_bom_header_tbl = > l_bom_header_tbl,
    X_bom_revisions_tbl = > l_bom_revisions_tbl,
    X_bom_components_tbl = > l_bom_components_tbl,
    X_bom_ref_designators_tbl = > l_bom_ref_designators_tbl,
    X_bom_sub_components_tbl = > l_bom_sub_components_tbl,
    X_bom_comp_ops_tbl = > l_bom_comp_ops_tbl,
    X_Err_Msg = > l_Err_Msg,
    X_Error_Code = > l_Error_Code);
    If l_Error_Code = 0 then


    because me in 1... l_bom_header_tbl. COUNTING LOOP
    V_bom_header_tbl.organization_code: = "DSC";

    Can assign us a table type of guy like below the registration statement?
    V_bom_header_tbl.assembly_item_name: is l_bom_header_tbl (i) .assembly_item_name;.

    k: = 1;

    I want to pass the l_bom_header_tbl (i) .assembly_item_name parameter in the declaration below: How do I do this?
    for j from 1... l_bom_components_tbl. COUNTING LOOP

    Can assign us a table type of type array as below the statement?
    v_bom_components_tbl (k). Assembly_Item_name: is l_bom_header_tbl (i) .assembly_item_name;.
    k: = k + 1;
    end LOOP;
    end loop;
    end;

    Published by: ILovePlSql on March 22, 2010 07:51

    Published by: ILovePlSql on March 22, 2010 08:16

    ILovePlSql wrote:
    V_bom_header_tbl emp % rowtype;

    If v_bom_header_tbl has just two fields as ename, sal then also the assignment of type table, record type work or if the record type and the array type have the same structure?

    Yes:

    SQL> declare
      2      type Bom_Head_Rec_Type is record(ename emp.ename%type,sal emp.sal%type);
      3      type BOM_HEADER_TBL_TYPE is table of Bom_Head_Rec_Type index by binary_integer;
      4      l_bom_header_tbl BOM_HEADER_TBL_TYPE;
      5      V_bom_header_tbl emp%rowtype;
      6  begin
      7      select ename,sal bulk collect into l_bom_header_tbl from emp;
      8      for i in 1 .. l_bom_header_tbl.count loop
      9        V_bom_header_tbl.ename := l_bom_header_tbl(i).ename;
     10        V_bom_header_tbl.sal := l_bom_header_tbl(i).sal;
     11      end loop;
     12  end;
     13  /
    
    PL/SQL procedure successfully completed.
    
    SQL>  
    

    SY.

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • for loops with the name of the layer.

    I developed a script that checks if the layer color-101 exists in an open document.

    If the layer color-101 exists executes the block of code on layer color-101.

    If the layer color-101 are not running action Add layer color-101.

    Back at the beginning of the loop to check again

    I do it with a loop for and if statement.

    1. Why does the loop not stop when the loop count variable corresponds to the layer color-101 name variable?

    2. how the loop can return to the beginning to check again the presence of color-101 layer?


    Variable decalre

    app.activeDocument = docRef;

    var theLayer = "color-101;

    loop through the layers

    for (var i = 0; i < docRef.layers.length; i ++) {}

    the layer name corresponds to the loop variable

    If (docRef.layers [i] .name == theLayer) {}

    Execute the block of code for layer color-101

    Alert ("Layer" + theLayer + "exist.");

    }

    }

    layer color-101 was not found, enforcement action Add layer color-101

    Alert ('The' + theLayer + "' there is no layer: Run Add layer color-101 action. '");

    back at the beginning of the loop and check again


    Your loop does not actually stop to find the right layer. He is content to display the alert popup window, then continues. Also the 'not found' - part will still raise. And the comparison must be 100% equal without difference case or spaces or 'copy 12' - suffixes.

    Try something like

    Declaring variables

    app.activeDocument = docRef;

    var layer_found = false;

    loop through the layers

    for (var i = 0; i)< docref.layers.length;="">

    var layer = docRef.layers [i]

    If (Layer.Name.toLowerCase (). IndexOf("case-101") > = 0) {}

    Alert ("found layer:" + layer.name);

    layer_found = true

    do what needs

    }

    }

    If (! layer_found) {}

    Alert ("Layer not found!");

    do what needs

    }

  • For loops with the array variable

    I am using a loop for example with the name of the table in the select variable, but get a compilation error

    for current_aud_row in (select * from ' | table_name |' where...)


    table_name contains the name of the actual table

    I do that I get the name of the table as a parameter.
    Help, please!

    Excellent. Oracle APEX (Application Express) is a web IDE and RTS - it makes heavy use of DBMS_SQL to execute SQLs and restore these dynamically in the form of Web-based reports, or turn it into XML for graphical rendering using Flash software.

    DBMS_SQL is perhaps more complex (and only really necessary when it comes true dynamic SQL at all stages - including the result of SQL), but we must know how to use and apply. It is a valuable tool at times.

  • Simple for loops with the table?

    Just a quick question!  I've been watching this for 2 hours and I searched everywhere, but always without success.

    I have a simple table containing elements.  When the user edits the page, I want that these elements in the array to become visible.

    var outfit:Array = ["Doll.Drawers.Shirt1", "Doll.Drawers.Pants1", "Doll.Drawers.Jacket1"];
    
    function f_item_show(event:MouseEvent):void
              {
                        for(var i:int = 0; i < outfit.length; i++)
                        { 
                                  trace(outfit[i]);
                                  this[outfit[i]].visible = true;  // THIS IS THE ISSUE //
      
                        }
              }
    
    

    The elements in the array are strings of the instance names, so I just need each string to be converted to an object and part .visible each element set to true.

    I know my loop works properly, because the trace reads accurately each instance name in the list.  I thought that this part [] would solve my problem, but it's not... I get this error message:

    TypeError: Error #1010: A term is undefined and has no properties.
              at PokeDress_fla::MainTimeline/f_item_show()
    
    

    I know it's one line of code, because it works perfectly when I delete.  All my instance names are correctly labeled and added, because they are used many times in the code without flaw.

    What I am doing wrong?

    To use the stand of notation, each medium can only represent a single object, so you would need three media since there are three objects in your channel... which means you would need three tables.

    If they appeal to target something inside the Doll.Drawers object, then you could simply store the shirts and pants and whatnot in the table as strings and use...

    Doll.Drawers [outfit [i]] .visible = true;

    What you should try instead is to store the actual paths to objects rather than representations of string of them, as in...

    var outfit:Array = [Doll.Drawers.Shirt1, Doll.Drawers.Pants1, etc...

    Then you should be able to use...

    costume [i] .visible = true;

  • Problems with nested for loops - save images from a camera


    Dear Norbert_B,

    Thank you for your response.  I solved the problem by using a sequence structure flat - file in the first image and all the treatment in the second! Easy as pi!

    Kind regards

    Miika

  • nested for loop

    I have positioning XY with two different controllers.

    the time of execution of these two controllers are different.

    I have attached block digram to understand. In highlight mode, code works very well... but in execution mode, step there gets delayed a little and moves with X stage.

    How can I make sure movement of steps one after the other.

    Thank you

    A simple data dependency is expected to create the design.

    Lynn

  • Create a directory tree: how to call a global function from inside a for loop

    Hello

    I am trying to create a workflow that will create a directory tree in vCenter.

    Concept:

    Basically, I am trying to execute nested for loops for each level of the tree to the caller a global tree.

    Problem:

    The 1st loop for works and creates the file 'Dev '.  The second loop for does not work with error message:

    [19:16:16.219 2013-06-27] [I] building Dev folder
    [19:16:16.474 2013-06-27] [I] directory Built: Dev
    [19:16:16.476 2013-06-27] [I] the records building servers
    [19:16:16.480 2013-06-27] [I] TypeError: cannot find the createFolder function in dev object. (Workflow: TEST_TNG_New_Site_Folder_Structure / Scriptable task (item2) #36)

    I think it has to do with JavaScript not being not able to call a global function in a nested object (I'm not a programmer and don't know JavaScript, so don't shoot me on that :)

    Code: (will clean this up once I do work)

    var folderBase is ['Dev', 'DMZ', 'Prod', 'UAT'];.

    var folderT1 = ["servers", "Jobs"];

    var folderT2 = ['Window', 'Linux'];

    var folderT3 is ["Repo2', 'Repo3', 'Repo1', 'Repo4'];.

    var folderT4 is ["T1", "T2", "T3"];.

    Create the files folderBase level

    for (var i = 0, l = folderBase.length; i < l; i ++) {}

    var rootFolder = parentFolder;

    buildFolderTree (folderBase [i]);

    Create the files folderT1 level

    for (var j = 0, l = folderT1.length; j < l; j ++) {}

    var rootFolder = folderBase [i];

    buildFolderTree (folderT1 [j]);

    Create the files folderT2 level

    for (var k = 0, l = folderT2.length; k < l; k ++) {}

    var rootFolder = folderT1 [j];

    buildFolderTree (folderT2 [k]);

    Create the files folderT3 level

    for (var x = 0, l = folderT3.length; x < l; x ++) {}

    var rootFolder = folderT2 [k];

    buildFolderTree (folderT3 [x]);

    Create the files folderT4 level

    for (var y = 0, l = folderT4.length; y < l; y ++) {}

    var rootFolder = folderT3 [x];

    buildFolderTree(folderT4[y]);

    }

    }

    }

    }

    }

    function buildFolderTree (folderName) {}

    System.log ("Building folder" + folderName);

    rootFolder.createFolder (folderName);

    System.log ("directory of frame:" + folderName);

    }

    Any help will be appreciated.

    Thank you

    B

    Hello

    The createFolder() method returns the object VcFolder to the folder just created, for the new file to be used immediately.  Here is how I modified the code:

    Create the files folderBase level
    for (var i = 0; i)
    var newBaseFolder = buildFolderTree (parentFolder, folderBase [i]);
    Create the files folderT1 level
    for (var j = 0; j)
    var newT1Folder = buildFolderTree (newBaseFolder, folderT1 [j]);
    Create the files folderT2 level
    for (var k = 0; k)
    var newT2Folder = buildFolderTree (newT1Folder, folderT2 [k]);
    Create the files folderT3 level
    for (var x = 0; x)
    var newT3Folder = buildFolderTree (newT2Folder, folderT3 [x]);
    Create the files folderT4 level
    for (var y = 0; y)
    var newT4Folder = buildFolderTree (newT3Folder, folderT4 [y]);
    }
    }
    }
    }
    }

    function buildFolderTree (parentFolderObj, folder_name) {}
    System.log ("Building folder" + folderName);
    var newFolder = parentFolderObj.createFolder (folderName);
    System.log ("directory of frame:" + folderName);
    return NewFolder;
    }

Maybe you are looking for

  • macOS Sierra/iTunes 12.5.1 - where is the option to view 3-pane column?

    I just upgraded to macOS Sierra and iTunes 12.5.1.21. I'm trying to find where I can display my iTunes library in that 3-pane column see, but I can not find the option. It can be under the view menu in iTunes. Does anyone know where it was moved to?

  • Order a different number of prints for each image

    If there is a way to order prints of different images different number? Say I want to order a print of all my images in a collection of 4 x 6, simple enough. Then, I want to order some of them also in format 8 x 10, also quite simple. But what I can'

  • How to delete record Toshiba taskbar after successful registration

    I followed the procedure for registration of Toshiba and made all the paperwork you sign up for my laptop.After sucessful Toshiba registration notice is stil in 'trey' bar (taskbar). How can I remove it? If I click on rigt mouse button disable regist

  • Windows media player 12, extract to this empty spot and do not respond

    I can't put is no longer where the rip of the files using the "rip music to this location" in the options in the media player. The address box does not exist in the rip to the options, and when I click on the "change" box (which is blue), nothing hap

  • 100 M175nw MFP Color LaserJet printing problem

    When I print a page, there is a separate area on the printed page that looks like a plastic clip or other object blocking the toner onto the paper. It does in black and color.  I want to know if it is likely to beinside the cartridge toner or some ot