identical random sorting for 2 tables

Hello

I had this function, which is sort my table in a random way.

private function randomSort(objA:Object, objB:Object):int {
       return Math.round(Math.random() * 2) - 1
}
arr.sort(randomSort);

I need to mix another table, but I need to have exactly the same random order than the first. If I use the same funcition:

arr2.sort(randomSort); 

I have different order in the two tables.

Is there a possibility to randomize the two tables in the order?

exactly.

then, you probably want to use:

private function randomSort(objA:Object, objB:Object):int {if(objA==objB){return 0;}       return 2*Math.round(Math.random())-1;}arr.sort(randomSort);

Tags: Adobe Animate

Similar Questions

  • Container for several tables of different length

    Hey,.

    I'm doing an algorithm for labelling component connected in LabVIEW.  I came across the problem that I need some sort of data structure that I can't create.  I hope that I've missed something and someone can report this to me.

    What I'm looking for is a container that can contain lists of lists of 2 values.  Basically, I have several labels.  Each label will have a list of coordinates in.  The closest I came to this creation is a 2D cluster table.  Then, the cluster contains the coordinates X and Y.  The problem is that each list is not the same size, and for a table of 2D in labVIEW, all rows/columns must have the same length.

    In summary, I'm looking for a way to store multiple lists of coordinates.  The lists will all be of different lengths, and I don't know how many lists there will be.

    Is it possible to do this?

    If not, does anyone know an easier way than that looking for a 2D for concentrations table all?  At the back of my mind, I want to say that there may be a Vision VI of OR who can do this, but I can't find a.

    Thanks for your help,

    Dominic Walker

    A way to manage several arrays of different lengths (but all the same type of data) is to put the berries in a queue.  Each element in the queue must be a table, but they can be of different lengths.  To get to all the tables, you use the preview queue feature.  It returns an array of clusters with each table queue in a separate group (if I remember correctly).   Perhaps an array of clusters of berries would work for you.  I just checked that this allows arrays of different lengths.  You can also place a control of the chain with the label of the cluster if it is appropriate.

    Lynn

  • "Random selection" for "Transitions" in Windows Movie Maker?

    For all that I can tell, Windows Movie Maker doesn't have a 'Random' selection for transitions.  It is this true or am I missing where the selection within the program?

    Hello ugotano,

    Welcome to the Microsoft Answers Forum!

    If you are looking for the option on how to change or add the transition in Movie Maker, here are the steps:

    1. on the table of the storyboard / timeline, click the second of the two video clips, titles or images that you want to add a transition between.
    2. click on tools, then on Transitions.
    3. in the content pane, click the transition that you want to add. You can click Play under the monitor to see a preview of what looks like the transition.
    4. click on the Clip and then click Add to timeline or add to the storyboard table.

    Here is an article you can do references who will give you information on the transitions:

    http://Windows.Microsoft.com/en-us/Windows-Vista/add-transitions-and-effects-to-pictures-and-video-in-Windows-Movie-Maker

    By default, Windows Movie Maker does not include transitions random, pans and zooms.  Adding Pan/zooms and transitions must be picture.
    You can apply the same transition to all the clamps at the same time:
    1. click on the 1st box of transition on the storyboard table (small box between the clips)
    2. do one of the following:
    3 Ctrl + A to select
    4 shift-click on the last transition box to select everything in between
    5 Ctrl-click the transitional areas to add them to the selection one by one.
    6. right click on the desired Transition and select "apply to the Storyboard object.

    I hope this information helps.

    Thank you
    H Irfan, Microsoft Answers Support Engineer.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • JDEV 12.2.1 sorting on a table

    We have improved our 11.1.2.3 app to 12.2.1 recently.

    If we have a table on the page and sort on a column, then the sorting works but it's really really slow. Anyone know what is the problem? or any solution to this problem?

    Turn journaling on the ADF BC layer to see the SQL code that is emitted from the DB for this table, then get your DBA to watch the execution plan for such a declaration of SQL on the DB.

    I guess that indexes and statistics on the table may need some tuning.

  • Removal of the preferences of sort for a specific region

    Version 4.2.6.00.03

    Hello

    I hope someone could help me with how to erase the preferences of sort for a specific region.

    I have a classic report with a column in place to apply sorting and a form of tab that has a column in place to apply the sort.

    I have a button to clear the sort who calls a process Page:

    BEGIN

    APEX_UTIL. REMOVE_SORT_PREFERENCES(:APP_USER);

    END;

    This clears the sorting on the two regions. So, how can I set it up to only clear the sorting on the form tab?

    Hope this is clear.

    Thank you

    Joe

    Joe R wrote:

    The link for the report of the admin user preference throws a 404 error.

    Oracle has moved and have apparently never heard of redirection rules: http://docs.oracle.com/cd/E23903_01/doc.41/e21678/aadm_mg_sessions.htm#CIHEADDF

    If you exceed this problem using the links in the old posts, simply remove the "/ doc" component of the path of the URL.

    I also had a Table or view does not exist on:

    SELECT *.

    OF WWV_FLOW_PREFERENCES$;

    This is why I suggested looking at the admin report. This table is not accessible to the public in a default installation, and the information is not exposed in one of the documented views of metadata. As you will see in the report, sorting preference is stored as a name/value pair:

    Name Value
    FSP1948_P8_R57820102721076385301_SORT fsp_sort_3_desc

    Where the name is of the form FSP_P_R_SORT, and the value is fsp_sort__. If you want to remove the preference, then the name is relevant, because it is the parameter required for the apex_util.remove_preference method. However, preferably the name will be different on each environment that the application is deployed, so it is to be determined dynamically. Give the region a static ID to use as an independent environment reference and use it in a query to determine the name preferably by using the ID of the internal region of the opinion of the APEX:

    begin
    
      for region in (
        select
            'FSP' || :app_id || '_P' || :app_page_id || '_R' || region_id || '_SORT' sort_pref
        from
            apex_application_page_regions
        where
            application_id = :app_id
        and page_id = :app_page_id
        and static_id = 'region-static-id')
      loop
        apex_util.remove_preference(region.sort_pref);
      end loop;
    
    end;
    

    Probably a good idea to create this as a reusable utility function.

  • They needed to seek random rownum in a table

    Hi all

    I need to go get two records random table, every time I question him. for example my_emp_table if it contains the unique employee ID, is possible to write a query that would give a two records of employees at random, say for the first record of employee of 11 and 18 and next run 20 and 28.

    We can get random values by select TRUNC (dbms_random.value (1,250)), TRUNC (dbms_random.value (1,250)) twice num
    But how to use these values to get the nth record using sql?

    Any help will be appreciated.

    Thank you very much!!
    -Shashank

    See my solution for that!

    select *
    from ( select *
              from tab1
                   , tab2
                   , tab3
                   , tab4
               where .....
               ORDER BY dbms_random.value
            )
    where rownum <= 2
    

    Published by: ascheffer on February 18, 2011 15:33

  • Pagination for adf table component

    Hello

    Y at - he no idea when the component of pagination for adf table will be available?

    This is in the roadmap of the ADF?

    Thank you
    Mike

    Hello

    There is no rejection of delivery defined for it. Sound in random discussion with no guarantee that this feature will be available.

    Frank

  • AS3 getting a random multiple number of table

    Hello:

    I have a hard time finding ways to manage the division with random numbers of tables using AS3.

    On my stage, I have two dynamic boxes; Box1 and box2 and a button, btn.

    in the Assembly, I have the following berries:

    var myDivisor:Array = [3,6,9,12,15,18,21,24,27,30];

    var myDivider:Array = [1,3,6];

    The idea is to divide 1 box per box of 2, so myDivisor should be a random number greater than a random number between myDivider

    WITH THE HELP OF BTN, HOW CAN I GET A RANDOM OF EACH TABLE, SO THIS DIVISOR NUMBER IS HIGHER THAN THE DIVISOR?

    In the timeline for button, here is the code:

    btn.addEventListerner (MouseEvent, CLICK, rNum);

    function rNum (MouseEvent): void

    {

    Box1. Math.Floor (Math.random) * myDivisor.length) / box2. Math.Floor (Math.random) * myDivider.leng th);

    }

    Please suggest ways to make this work.

    German

    var myDivisor:Array = new Array (3,6,9,12,15,18,21,24,27,30,23,89,90,1,34,56,78,99,345,456);
    var myDivider:Array = new Array (1,3,6);
    var divisor: int;
    var divisor: int;

    getNumbers();
    function getNumbers() {}
    divisor = getRandom (myDivisor);
    divisor = getRandom (myDivider);
    checkValues();
    }
    function getRandom(array:Array):int {}

    var NombrAl = Math.floor (Math.random () * array.length);
    return table [NombrAl];

    }
    function checkValues() {}
    If (getRandom (myDivisor) > getRandom (myDivider)) {}
    trace (getRandom (myDivisor));
    trace (getRandom (myDivider));

    } else {}
    getNumbers();
    }
    }

  • Random sorting of files.

    Is there a way to do a random sorting of wav or mp3 files? They are now sorted by artist name and each file is named by the artist and title of the song. Under file/display/sort there is no option that would randomize the list of files.

    Hello, B E Withers

    In Windows Media Player, when you add songs to the playlist, click the playing tab, then click on the icon next to the Play/Pause button that looks like two arrows cross as an X to scramble the reading - the X will highlight when activated. Note that the list of reading will not change, but will be of the order of reading.

    If you burn files through Windows Media Player and you want the randomized go to the tab burn and after you add your tracks, click the drop-down list menu burn and Shuffle list now the choice.

    Let us know if that helps.

    David
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How are derived from the random bits for new AESKey()?

    I was not able to find any documentation on how the random key is generated. There has been discussions on various security forums recently on the use of random number generators nickname (PRNG).

    I would like confirmation that the random bits for new AESKey() come from cryptographically safe pounds (like net.rim.device.api.crypto.RandomSource?).

    Random data used in the constructor of AESKey() comes from net.rim.device.api.crypto.RandomSource.

  • Iterator for the table and form is a problem during the cleaning of the records

    Hello

    I use JDev 12.1.2.

    I have an object of the detail view. I represent a part of its fields in a table and the rest in a form. I use the same iterator. Basically, I dragged and dropped the object even from the view of the data control and created a table and form layout with the fields I wanted in each provision. I put in place a clear feature for the rows in the table with a clear"" key. -on click I delete the line of the iterator in the managed bean. When I do this the selected record is deleted and the next record is displayed. But fields entered in the form layout also gets deleted. (the form should also be showing the record currently selected - it shows but entrable fields in the form are deleted because of claire that I did on the previous line.) If anyone can help get this resolved?

    Not use the same iterator for the tables and forms here? The links are in the row (row.bindings...) for the table, but for the form it is (links...). The Delete on the current row operation is causing the iterator delete all fields of links instead of from the line? Please shed some light.

    Thank you

    UMA

    How do you rank on the iterator compensation?

    use resetActionListener in your clear button and let us know what is happening?

    Ashish

  • How to get a magic number for any table that returns more than 32 k?

    I'm in a unique situation where in I try to extract the values of the multiple tables and to publish as XML output. The problem is based on the condition of a few tables can retrieve more than 32 KB and less than 32 KB of data. Less than 32KB is not a problem, as the generation of XML is smooth. The minute he reached more than 32 k, it generates a runtime error. I was wondering if there is a way to make sure that the minute results of the query is greater than 32 KB, it must break say - if results is 35KO, so should I break this result 32 KB and 3 KB. Once then pass these data to appear as XML output. Again, it is not just for a table, but all the tables which are called in the function.

    Is it possible? I'm unable to get ideas, or did I do something so complex from the point of view of production support. If you'd be grateful if someone can guide me on this.

    The way it is, is the following:
    I have a table named ctn_pub_cntl


    CREATE TABLE CTNAPP.ctn_pub_cntl 
    (ctn_pub_cntl_id          NUMBER(18)
    ,table_name                  VARCHAR2(50)
    ,last_pub_tms              DATE
    ,queue_name               VARCHAR2(50)
    ,dest_system              VARCHAR2(50)
    ,frequency                  NUMBER(6)
    ,status                      VARCHAR2(8)
    ,record_create_tms          DATE
    ,create_user_id                VARCHAR2(8)
    ,record_update_tms          DATE
    ,update_user_id             VARCHAR2(8)
    ,CONSTRAINT ctn_pub_cntl_id_pk PRIMARY KEY(ctn_pub_cntl_id)
    );
    
    

    To do this, the data are:


    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_SBDVSN'
    ,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.TSZ601.UNP'
    ,'SAP'
    ,15
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
     ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_TRACK_SGMNT_DN'
    ,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN_DN'
    ,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.YRDPLN.INPUT'
    ,'SAP'
    ,30
    ); 
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
    ,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.TSZ601.UNP'
    ,'SAP'
    ,120
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
    ,TO_DATE('04/23/2015 11:50:00PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.YRDPLN.INPUT'
    ,'SAP'
    ,10
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FIXED_PLANT_ASSET'
    ,TO_DATE('04/23/2015 11:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,10
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_OPRLMT'
    ,TO_DATE('03/26/2015 7:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_OPRLMT_SGMNT_DN'
    ,TO_DATE('03/28/2015 12:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    /
    
    COMMIT;
    
    

    Once the above data are inserted and committed, then I created a feature in a package:


    CREATE OR REPLACE PACKAGE CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
    IS
    
    TYPE tNameTyp IS TABLE OF ctn_pub_cntl.table_name%TYPE INDEX BY BINARY_INTEGER;
    g_tName tNameTyp;
    
    TYPE tClobTyp IS TABLE OF CLOB INDEX BY BINARY_INTEGER;
    g_tClob tClobTyp;
    
    
    FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_count OUT NUMBER ) RETURN tClobTyp;
    
    
    END CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH;
    
    
    --Package body
    
    CREATE OR REPLACE PACKAGE BODY CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
    IS
    
         doc           xmldom.DOMDocument;
         main_node     xmldom.DOMNode;
         root_node     xmldom.DOMNode;
         root_elmt     xmldom.DOMElement;
         child_node    xmldom.DOMNode;
         child_elmt    xmldom.DOMElement;
         leaf_node     xmldom.DOMNode;
         elmt_value    xmldom.DOMText;
         tbl_node      xmldom.DOMNode;
         table_data    XMLDOM.DOMDOCUMENTFRAGMENT;
      
         l_ctx         DBMS_XMLGEN.CTXHANDLE;
         vStrSqlQuery  VARCHAR2(32767);
         l_clob        tClobTyp;
         --
         l_xmltype     XMLTYPE;
         --
    --Local Procedure to build XML header     
    PROCEDURE BuildCPRHeader IS
    
      BEGIN
        child_elmt := xmldom.createElement(doc, 'PUBLISH_HEADER');
        child_node  := xmldom.appendChild (root_node, xmldom.makeNode (child_elmt));
    
        child_elmt := xmldom.createElement (doc, 'SOURCE_APLCTN_ID');
        elmt_value := xmldom.createTextNode (doc, 'CTN');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
        
        child_elmt := xmldom.createElement (doc, 'SOURCE_PRGRM_ID');
        elmt_value := xmldom.createTextNode (doc, 'VALUE');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
    
        child_elmt := xmldom.createElement (doc, 'SOURCE_CMPNT_ID');
        elmt_value := xmldom.createTextNode (doc, 'VALUE');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
    
        child_elmt := xmldom.createElement (doc, 'PUBLISH_TMS');
        elmt_value := xmldom.createTextNode (doc, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
        
    END BuildCPRHeader;
    
    --Get table data based on table name
    FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_Count OUT NUMBER) RETURN tClobTyp IS
        
        vTblName      ctn_pub_cntl.table_name%TYPE;
        vLastPubTms   ctn_pub_cntl.last_pub_tms%TYPE;
         
    BEGIN
                g_vProcedureName:='GetCtnData';    
                g_vTableName:='CTN_PUB_CNTL';
                
            SELECT table_name,last_pub_tms
            INTO   vTblName, vLastPubTms
            FROM   CTN_PUB_CNTL
            WHERE  ctn_pub_cntl_id=p_nInCtnPubCntlID;
        
        -- Start the XML Message generation
            doc := xmldom.newDOMDocument;
            main_node := xmldom.makeNode(doc);
            root_elmt := xmldom.createElement(doc, 'PUBLISH');
            root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
            
          --Append Table Data as Publish Header
            BuildCPRHeader;
            
          --Append Table Data as Publish Body
          
           child_elmt := xmldom.createElement(doc, 'PUBLISH_BODY');
           leaf_node  := xmldom.appendChild (root_node, xmldom.makeNode(child_elmt)); 
           
           DBMS_SESSION.SET_NLS('NLS_DATE_FORMAT','''YYYY:MM:DD HH24:MI:SS''');
           
           vStrSqlQuery := 'SELECT * FROM ' || vTblName 
                          || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
                        --  ||  ' AND rownum < 16'
                          --;
          DBMS_OUTPUT.PUT_LINE(vStrSqlQuery);
           
           l_ctx  := DBMS_XMLGEN.NEWCONTEXT(vStrSqlQuery);
          DBMS_XMLGEN.SETNULLHANDLING(l_ctx, 0);
          DBMS_XMLGEN.SETROWSETTAG(l_ctx, vTblName); 
           
          -- Append Table Data as XML Fragment
          l_clob(1):=DBMS_XMLGEN.GETXML(l_ctx);  
          elmt_value := xmldom.createTextNode (doc, l_clob(1)); 
         leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value)); 
         
         xmldom.writeToBuffer (doc, l_clob(1));
         l_clob(1):=REPLACE(l_clob(1),'&lt;?xml version=&quot;1.0&quot;?&gt;', NULL);
         l_clob(1):=REPLACE(l_clob(1),'&lt;', '<');
         l_clob(1):=REPLACE(l_clob(1),'&gt;', '>');
         
         RETURN l_clob;
         
         DBMS_OUTPUT.put_line('Answer is' ||l_clob(1));
         
         EXCEPTION
            
            WHEN NO_DATA_FOUND THEN
            
            DBMS_OUTPUT.put_line('There is no data with' || SQLERRM);
            g_vProcedureName:='GetCtnData';
            g_vTableName:='CTN_PUB_CNTL';
            g_vErrorMessage:=SQLERRM|| g_vErrorMessage;
            g_nSqlCd:=SQLCODE;
            ctn_log_error('ERROR',g_vErrorMessage,'SELECT',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
            
            
            WHEN OTHERS THEN
           
           DBMS_OUTPUT.PUT_LINE('ERROR : ' || SQLERRM);
           ctn_log_error('ERROR',g_vErrorMessage,'OTHERS',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
           
    END GetCtnData;
    
    
    PROCEDURE printClob (result IN OUT NOCOPY CLOB) IS
        xmlstr   VARCHAR2 (32767);
        line     VARCHAR2 (2000);
    BEGIN
        xmlstr := DBMS_LOB.SUBSTR (result, 32767);
    
        LOOP
           EXIT WHEN xmlstr IS NULL;
           line := SUBSTR (xmlstr, 1, INSTR (xmlstr, CHR (10)) - 1);
           DBMS_OUTPUT.put_line (line);
           xmlstr := SUBSTR (xmlstr, INSTR (xmlstr, CHR (10)) + 1);
        END LOOP;
    END printClob;
    
    END CTN_PUB_CNTL_EXTRACT_PUBLISH;
    
     
    

    If you notice my query:


    vStrSqlQuery := 'SELECT * FROM ' || vTblName 
                          || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
                         ||  ' AND rownum < 16'
                        ;
    

    The minute I comment

    ||  ' AND rownum < 16' ;


    It generates an error because this query returns about 600 lines and all these lines must be published in XML format and the tragedy, is that it is a C program between institutions i.e. C calls my functions of packged and then will do all the processing. This will return the results to the C program. Then obviously C does not recognize the CLOB and somewhere in the process, I convert to VARCHAR or CLOB CLOB, I have to use VARCHAR as a return type. That's my challenge.


    Someone who can help me find the number required of magic and also a brief knows how, I understand that. Thanks in advance.

    Not that I would use it myself but your package can be simplified down, like this:

    create or replace package ctn_pub_cntl_extract_publish is
    
      C_DTFORMAT  constant varchar2(30) := 'YYYY-MM-DD HH24:MI:SS';
    
      function getXMLData (p_table_name in varchar2, p_pub_tms in date) return xmltype;
      function getCTNData (p_id in number) return clob;
    
    end ctn_pub_cntl_extract_publish;
    /
    
    create or replace package body ctn_pub_cntl_extract_publish is
    
      function getXMLData (p_table_name in varchar2, p_pub_tms in date)
      return xmltype
      is
    
        v_query  varchar2(32767) :=
                 q'{select * from $$TABLE_NAME where record_update_tms <= to_date(:1, 'YYYYMMDDHH24MISS')}';
    
        ctx      dbms_xmlgen.ctxHandle;
        doc      xmltype;
    
      begin
    
        execute immediate 'alter session set nls_date_format = "'||C_DTFORMAT||'"';
        v_query := replace(v_query, '$$TABLE_NAME', dbms_assert.simple_sql_name(p_table_name)); 
    
        ctx := dbms_xmlgen.newContext(v_query);
        dbms_xmlgen.setBindValue(ctx, '1', to_char(p_pub_tms, 'YYYYMMDDHH24MISS'));
        dbms_xmlgen.setRowSetTag(ctx, p_table_name);
        dbms_xmlgen.setNullHandling(ctx, dbms_xmlgen.DROP_NULLS);
        doc := dbms_xmlgen.getXMLType(ctx);
        dbms_xmlgen.closeContext(ctx);
    
        return doc; 
    
      end;
    
      function getCTNData (p_id in number)
      return clob
      is
    
        doc  clob;
    
      begin
    
        select xmlserialize(document
                 xmlelement("PUBLISH"
                 , xmlelement("PUBLISH_HEADER"
                   , xmlforest(
                       'CNT' as "SOURCE_APLCTN_ID"
                     , 'VALUE' as "SOURCE_PRGRM_ID"
                     , 'VALUE' as "SOURCE_CMPNT_ID"
                     , to_char(sysdate, C_DTFORMAT) as "PUBLISH_TMS"
                     )
                   )
                 , xmlelement("PUBLISH_BODY"
                   , getXMLData(t.table_name, t.last_pub_tms)
                   )
                 )
               )
        into doc
        from ctn_pub_cntl t
        where t.ctn_pub_cntl_id = p_id;
    
        return doc;
    
      end;
    
    end ctn_pub_cntl_extract_publish;
    

    Function getXMLData() generates a canonical XML document out of the table that is passed as a parameter.

    Function built getCTNData() code XML "PUBLISH", the document using SQL/XML functions, the getXMLData() call in the process and returns the content serialized as a CLOB.

  • Enable auditing for editing table

    Hi all

    IM pretty new to Oracle. We had a problem that a of our customer base devastated by some indexes became unusable. These indices are not on a partitioned table. I came to the conclusion that these indices are rendered useless by the action of the user. Is there another explanation? To get a better proof in the future on how an unusable index so I decided to use the audit, I have never done before the audit so would like to get some suggestions from this forum.

    Database: Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0

    OS: Oracle Solaris 10 SPARC 64 bit

    Maybe, but not completely.

    For a Table partitioned, Partition peacekeeping operations can lead to unpartitioned indexes or partitions of a partitioned index becomes UNUSABLE.  It could be captured by the audit.

    SQLLoader direct route which could not leave the unusable index - this could not take advantage of the audit.

    You need to know what operations are performed on the table.

    Hemant K Collette

  • Is it possible to implement or imitate the "percentage of parent row" feature, planned for PivotTables in obiee 11g, for a table of "normal"?

    Is it possible to set work/MIMC the "percentage of parent row" feature, planned for PivotTables in obiee 11g, for a table of "normal"?

    I'm able to calculate the percentage of parent row in "pivot table". but it's not getting displayed when I see him through graphic.

    Any way to calculate the "percentage of parent of the line" using the normal table and if I can use this column calculated on the chart. really appreciate your response.

    Thank you

    SAI.

    Hi Sai,

    You must be able to calculate the % using "SUM (measure at THE level [, level1, Middle])" to get the total of the top level of your line and to a share of the present value of the total (and * 100.0).

  • Completely random behavior for script of division. Need help :)

    Hi people,

    I put a lot of hard work in a form for a client (with the much appreciated help of people on these cards) and I thought it was full but...

    The customer got my attention on a seemingly random behavior for 2 fields on the form.

    I have no knowledge of Javascript but, based on the research online, I came with a custom script. I've rechecked the script but can't understand why random behavior would occur.

    Here are the scripts for 2 fields:

    Basic loan

    ----------------------------------------------------------

    (function () {}

    Get the field values as numbers

    var numerator = + getField("Loan_Amount_3_L2").value;

    denominator = var + getField("Bank_Value").value;

    Do the math if the denominator does not evaluate to zero

    If (denominator! == 0) {}

    Event.Value = numerator / denominator.

    } else {}

    Event.Value = "";

    }

    })();

    Ready

    ----------------------------------------------------------

    (function () {}

    Get the field values as numbers

    var numerator = + getField("Total_Loan_2_L2").value;

    denominator = var + getField("Bank_Value").value;

    Do the math if the denominator does not evaluate to zero

    If (denominator! == 0) {}

    Event.Value = numerator / denominator.

    } else {}

    Event.Value = "";

    }

    })();

    ----------------------------------------------------------

    And here's screenshots of the completely random behavior:

    Below if we begin to enter numbers... and things look OK. $500,000 divided by $500,000 = 100 percent

    pic1.jpg

    Below, we add more numbers. Now, things are unhinged. Here, the result of 92% is incorrect. $400,000 divided $ 500,000 must be equal to 80%.

    pic2.jpg

    Then below the plot thickens again when we add more numbers. Here the basic loan value is correct at 80%, but the end of loan value is not correct. The ready value must be equal to 81% - not 80% ($ 405 000 divided by $500,000 = 81%)

    pic3.jpg

    As a side note, if I do a simplified field notation, the calculations seem to work. The reason why I do not have a simplified field notation, however, is that I get those annoying WARNING come up:

    Warning 1: "The value entered does not match the format [Base_Loan_to_Value_Ratio_LVR_L2]"

    Warning 2: "The value entered does not match the format [End_Loan_to_Value_Ratio_LVR_2]"

    (The fields mentioned in these warnings are the destination fields that produce the above incorrect percentage values).

    Could someone please identify what is happening here? Why is there such a seemingly random variation? And how can I solve this problem?

    Thank you

    Did you check the order of calculation of (different from the tab order) field to make sure it makes sense that the form?

Maybe you are looking for

  • Flash player does not

    Flash player is not loading videos on youtube and streaming sites saying I don't have the plugin or just black screen. I updated the flash player and the bottom ranked it, I also tried to update firefox but just is not updated, close firefox and char

  • Icon in the taskbar for Word has changed to the icon of the program unknown

    First of all, everything works fine, but it is really annoying that the icon in my taskbar for Word 07 disappeared and is represented by the generic icon of the unknown program.  In my documents files, the icon shows correctly, but in my program (fro

  • The Audio driver is missing?

    The Audio still work and now in some programs like Windows Media Player and iTunes audio works always, but in the game, (Aka, Roblox) programs, and Midi files do not work for any reason, please help this problems.

  • Palm Pre Plus 3 G Mobile Hotspot guard fall Ubuntu 9.10 (Verizon)

    Well, it could be that Ubuntu keeps dropping the Hotspot... I just got the Pre, and set up the point.  I am able to connect to the hotspot with Ubuntu 9.10, Win XP and Win 7 without a hitch using WPA/WPA2 Personal or open connections.  The service is

  • Incorrect spelling in stock photo

    How can I tell someone at Adobe Stock one of their pictures contains a misspelled word in it?fraud on the keyboard word - image | Adobe Stock