NonPersistableObjectException on commit () [code]

I use the following data record to store relevant data as a persistent object:

[code]

Import packages
Net.rim.device.api.util import. *;
Import Java.util;

/ public class SentBM_Data implements Persistable
{
Private members
 
Public members
public int ID;
public boolean initialized = false;
public int PIN;
public Vector storedPackets;         Datagram
public Vector brokenServer;          Byte]
 
Builders
public SentBM_Data)
{
for (int count = 0; count)< 50;="">
{
Debugging
System.out.println ("created data object");
}
    
storedPackets = new Vector (1, 1);
brokenServer = new Vector (1, 1);
}
 
public SentBM_Data (int boxID)
{
Debugging
System.out.println ("created data object");
    
storedPackets = new Vector (1);
brokenServer = new Vector (1, 1);
    
ID = boxID;
}
 
public static generateID Sub)
{
TODO: Check in with the BlackBerry PIN
TODO: set the ID field to the returned boxID (default if PIN invalid)
}
 
public String toString)
{
String content = "";
    
content += "case ID:"+ ID + "\n"; '.
content += "Initialized?:" + initialized + "\n"; "."
content += "PIN:" + PIN + "/ n"; "."
content += "Unbuilt stored packages:"+ brokenServer.size () + "\n"; '.
content += "built the stored packages:"+ storedPackets.size () + "\n"; '.
    
return the content;
}
}

[/ code]

I have an appData global object of the type SentBM_Data in which I make the changes and use the following code to commit the changes:

[code]

synchronized (BSMData)
{
BSMData.setContents (appData);
BSMData.commit ();
}

[/ code]

For some reason any him commit this change started recently throw a NonPersistableObjectException, even a new run (flash memory at the start of simulator of compensation). I was getting this error before, and I've changed anything which involves the recording of the above data and receive this error message. Any ideas?

Current Simulator: Bold 9000

EDIT: I should mention that I use Eclipse version 3.4.1 with plugin 1.0.0.67 version

Make a differential diagnosis in commenting on the two carriers first and see if you can store the object.

If it works, comment in the vector with the Byte [] and if it works comment back of the vector with the object of datagram, if it fails, then you know why.

Looking through the JavaDoc, you will find the following elements of the Persistable interface

A class must explicitly implement this interface for the system store instances of the persistent class. Make the subfamily (s) not inherit implementation of this interface.

Class DatagramBase (that implements the datagram that implements Persistable new) does not implement explicitly Persistable not it he inherited only from its super class DataBuffer, which means according to the JavaDoc comment above, that DatagramBase objects are not persitable.

Tags: BlackBerry Developers

Similar Questions

  • XMLquery - contours do not used throughout the code, but only in the xml request selected

    Hello

    We use-> database Oracle 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit
    We have a part of our system of s/w works as:
    Drop table xml_tbl
    
    create table xml_tbl (
    xml_msg_id integer,
    xml_msg_text xmltype
    );
    
    insert into xml_tbl values(1, '<main xmlns:ns1="Abc:SET"><ns1:id>1</ns1:id></main>');
    insert into xml_tbl values(1, '<main xmlns:ns1="Abc:SET"><ns1:id>1</ns1:id></main>');
    insert into xml_tbl values(1, '<main xmlns:ns1="Abc:SET"><ns1:id>2</ns1:id></main>');
    commit;
    
    --Code
    
    DECLARE
       v_output   CLOB;
    
       FUNCTION fn_xmlquery (p_date IN DATE)
          RETURN XMLTYPE
       AS
          v_xmlout   XMLTYPE;
          v_query    CLOB
             := TO_CLOB (
                   'declare namespace ns1 = "Abc:SET"; fn:count($File_Data/main/ns1:id)');
       BEGIN
          SELECT XMLQUERY (v_query
                           PASSING t_tbl.xml AS "File_Data" RETURNING CONTENT)
            INTO v_xmlout
            FROM (SELECT XMLAGG (xml_msg_text) AS xml
                    FROM xml_tbl t
                   WHERE XMLEXISTS (
                            'declare namespace ns1 = "Abc:SET";  /main/ns1:id = ("1") '
                            PASSING xml_msg_text)) t_tbl;
    
          RETURN (v_xmlout);
       END fn_xmlquery;
    BEGIN
       v_output :=
          XMLType.getClobVal (fn_xmlquery (TO_DATE ('20121231', 'YYYYMMDD')));
       DBMS_OUTPUT.put_line (v_output);
    END;
    
    --Now if I try the outline on xml_tbl query as:
    
    drop outline o_name;
    
    CREATE OUTLINE o_name ON
    SELECT XMLAGG (xml_msg_text) AS xml
                    FROM xml_tbl t
                   WHERE XMLEXISTS (
                            'declare namespace ns1 = "Abc:SET";  /main/ns1:id = ("1") '
                            PASSING xml_msg_text);
    
    
    select * from dba_outlines;
    If we execute just this request again, contour O_Name is used as can be seen in:
    Select * from dba_outlines;
    It is used in the two schemas in DB, as we wish.

    But if we execute all the code above, it takes, to make all the xquery deals.
    O_Name OUTLINE is not used. Not even in the same pattern.
    You can try the above, in your machine to replicate.

    Please suggest how to do the work described in this case. As things do not work in our system at all because the query plan wrong by the above query on which we create the contour.
    Thank you...

    Published by: user8941550 on January 9, 2013 23:16

    Maybe the XQuery Modules will build in a future version of the database.

    So please can you suggest a better way we can use so that we can avoid the dynamic xquery thing.

    Make the dynamic SQL set instead, not only the request XQuery and run it via EXECUTE IMMEDIATE or DBMS_SQL.
    This way, the CBO know XQ expression to analyze the time and be able to optimize it.

    I'm not a big fan of this approach, but the lack of something better.

  • Need to update several lines in a multi-line table in another

    I came to the conclusion that I can't do that because of the absence of a unique key that is related, but maybe you can help me with a solution. I tried all of the solutions posted here, but they do not work in my scenario. I have codes in a table that is a list of codes to the related market which they should be used for. I have a second table of customers who do not have the code assigned to them until they are sent to an advertisement. This table has the market_id for each customer and the table of codes has the market_id associated with each code. I want to update the customer table with one of the associated with the market_id mergecodes - but between the two tables you isn't a unique key to connect. I thought I could just update the records which had corresponding market_ids, but nothing works. In the two tables below, I want to be able to update t3tm.mergecode with one of the mergecodes that has the same market_id ("Austin") in t3mc. It does not matter that it is associated with a particular customer.

    {code}

    create table T3mc (use of mergecode varchar (10), market_id varchar (25), week number, varchar2 (5));

    Insert into T3mc values ('A8976","Austin", 2,");
    Insert into T3mc values ('A8988","Austin", 2,");
    Insert into T3mc values ("A9900", "Houston", 2, ");
    commit;

    create table T3tm (name varchar (20), market_id varchar (25), mergecode varchar (10), identification number);

    insert into T3tm Values ('Smith', 'Austin' ", 1);
    insert into T3tm Values ("Jones", "Austin", ", 2);
    commit;
    {code}

    {code}
    Select * from T3mc;
    MARKET_ID, WEEK, USED, MERGECODE
    Austin 2 A8976 (null)
    Austin 2 A8988 (null)
    Houston 3 A9900 (null)
    Select * from T3tm;

    LAST_NAME, MARKET_ID, MERGECODE ID
    Austin Smith (null) 1
    Austin Jones (null) 2
    {code}

    ti3r wrote:
    In the two tables below, I want to be able to update t3tm.mergecode with one of the mergecodes that has the same market_id ("Austin") in t3mc. It does not matter that it is associated with a particular customer.

    {code}
    update of T3tm one
    Set mergecode =)
    Select mergecode
    of T3mc b
    where b.market_id = a.market_id
    and rownum = 1
    )
    where market_id in)
    Select market_id
    of T3mc
    )
    /

    2 lines to date.

    SQL > select *.
    2 of T3tm
    3.

    LAST_NAME MARKET_ID MERGECODE ID
    -------------------- ------------------------- ---------- ----------
    Austin A8976 Smith 1
    Austin A8976 Jones 2

    SQL >
    {code}

    SY.

  • Need help pulling a name string

    Hello I'm on Oracle 11 GR 1 material and have a strings of data like these:

    SMITH, KAY C. RN, FNP
    WESTON, DEBRA, L
    ASH, CHRISTOPHER, J., PA - C
    EYEBROWS, CATHERINE J MSN NOCD
    ASH, MICHELLE
    NASH, BOB MC T MD
    BROWN-JONES, LARRY RN

    I need to enter these:
    LAST_NAME
    FIRST NAME
    MI
    CODE (the first one)

    So, if we where to watch again the data after it is pulled apart, I would like to see this:
     
    LAST_NAME     FIRST_NAME     MI    CODE 
    SMITH         KAY            C     RN 
    WESTTON       DEBRA          L       
    ASH           CHRISTOPHER    J     PA-C 
    BROW          CATHERINE      J     MSN 
    ASH           MICHELLE 
    That's what I have (this code will be executed on an external Table with 1.5mil lines):
     
    select 
        substr('SMITH, KAY C. RN, FNP',1,instr('SMITH, KAY C. RN, FNP',',')-1) as LAST_NAME, 
        regexp_substr(SMITH, KAY C. RN, FNP', '[^, ]+ ') as FIRST_NAME 
    from dual; 
    I don't know how to get the rest.

    Thanks for any help

    Published by: Sky13 on September 23, 2011 12:04
    I added a few samples more

    Hello

    Look at the data and try to find some patterns. You will not be able to get everything right, but you may be able to make the most of them.
    I would look for things:
    There always at least 1 comma in the chain? Are you sure that what comes before the (first) comma is always a name?
    When there are 2 commas, codes never come before the 2nd comma?
    Codes always come after the names?
    What parts are sometimes missing? How many times they lack?
    Never just 1 character codes?
    Some codes occur very frequently?
    Is this practice to create a table of the most common codes, or even all the codes?

    It will be much easier in PL/SQL.
    You can write a procedure which takes 1 IN argument (the plain text) and 5 on arguemnts:
    (1) first name
    (2) first name
    (3) other initial
    (4) code
    (5) a number indicating what is the probability that the results are correct. For example, 100 may indicate a very simple string, such as "Dyer, Mary. You can print the with the lowest number for some person to review manually.

    Good luck!

  • transaction in a procedure

    Hello
    I've implemented this procedure but I don't know about the syntax.
    I have 4 operations. The examples I've looked at don't seem to have the 'end' between each transaction. I don't know how word error messages, I have I don't have one, when you insert values.
    I think I have the right to record.
    An example I looked said to name the transaction as I did and the other example said to set the name of the transaction to 'rollback_rs1.
    Is how important it?
    I have to name each transaction (1,2,3,4)? I do not think, but yet again, I'm not sure.
    I use oracle 10.2.0.3
    Here is the table, it is emptey at this time.
    {code}
    Catalogue of DROP TABLE CASCADE CONSTRAINTS;
    CREATE TABLE catalog
    (NUMBER OF NOCS,
    Varchar2 (25) CTITRE,.
    CREATED_BY varchar2 (30),
    CREATED_DATE date,
    UPDATED_BY varchar2 (30),
    Date of UPDATED_DATE);
    {code}

    my surgery is lower with comments where I don't know if I'm right.
    -It comes to question3. create a procedure
    -who will perform the operations of insertion of values in the catalog table.

    {code}
    CREATE OR REPLACE PROCEDURE week_11
    Start
    Set transaction read write catalogue name - is that correct?

    Insert into catalog
    VALUES ("cmis420", "Advanced Relational Database", "Bill Warren', sysdate,"Jean Todd", sysdate);
    Insert into catalog
    VALUES ('CMST385', 'Introduction to XHTML', 'Terry Woods", sysdate, 'john Miller', sysdate);

    SAVEPOINT cmis420_cno;

    EXCEPTION - is this true or do I have to use the clause "IF"?
    while others then
    dbms_output.put_line (SQLERRM);
    Rollback; -If an error occurs rollback.
    -I don't know how to do this part... display message if an error occurred, then roll back the transaction.

    Insert into catalog
    VALUES ('cmst170', 'Introduction to XML', ' richard Jones, sysdate, 'Mary Smith', sysdate);
    Insert into catalog
    values ('CMIS315', "Programming in C++", "richard Jones, sysdate, 'Paul Todd', sysdate);
    SAVEPOINT cmst170_cno;
    exception
    while others then
    dbms_output.put_line (SQLERRM);

    Rollback; -If an error occurs rollback.
    -I don't know how to do this part... DisplayMessage if an error occurred, then roll back the transaction.


    Insert into catalog
    values ('CMIS111', ' Social Networking and cybersecurity best practices, "Terry Woods", sysdate, 'john Miller', sysdate); »
    Insert into catalog
    values ('CMIS125', in Programming', sysdate, c# ', "richard Jones, sysdate, Peter Greenburg, sysdate);
    SAVEPOINT cmis111_cno;

    exception
    while others then
    dbms_output.put_line (SQLERRM);

    Rollback; -If an error occurs rollback.
    -I don't know how to do this part... display message if an error occurred, then roll back the transaction.


    Insert into catalog
    values ('CMIS225', 'Windows Presentation Foundation (WPF) development', "George Allen", sysdate, 'Richard Jones' sysdate);
    Insert into catalog
    values ('CMIS465', 'Software' and Validation, sysdate, 'Bill Warren', sysdate, "Jean Todd");

    SAVEPOINT cmis225_cno;

    exception
    while others then
    dbms_output.put_line (SQLERRM);
    backup restore point cmst170_cno; -If an error occurs rollback transaction 2 using the restore.
    -I don't know how to do this part... display message if an error occurred, then roll back the transaction.
    end;
    commit;
    {code}

    I appreciate any help you can give
    kabrajo

    Published by: BluShadow on August 15, 2011 13:00
    Add tags {noformat} {code} {noformat}. Please read {message identifier: = 9360002} to learn how to do it yourself.

    Closer-
    If you want an exception handler in the inserts, you use this structure:

    BEGIN
        (your code, inserts, whatever)
    EXCEPTION
         WHEN (what you are trapping)
    END;
    

    If you are missing this syntax.

    Insert into catalog
    VALUES ("cmis420", "Advanced Relational Database", "Bill Warren', sysdate,"Jean Todd", sysdate);
    Insert into catalog
    VALUES ('CMST385', 'Introduction to XHTML', 'Terry Woods", sysdate, 'john Miller', sysdate);

    EXCEPTION
    WHILE OTHERS THEN


    DBMS_OUTPUT. Put_line (' error insertion class: ': substr (SQLERRM, 1, 75));
    ROLLBACK;

    I don't know your needs, but you should review the logic here and see if that's really what you intend to happen. You do: insertion of 2 lines. If there is an error message on the screen. Then, because ERROR has BEEN HANDLED, your program will pronounce on the next 2 inserts, etc. If that's what you intend, very well, but from my experience, this is not the typical requirement.

    It is also very important out of the habit of using SO many OTHER as your exclusive exceptions management method. Much more appropriate in this case would be:

    WHEN DUP_VAL_ON_INDEX THEN    (whatever particular error you might raise)
         (insert or whatever)
    WHEN OTHERS THEN
         (code for something unexpected)
    END
    

    If you have access, I highly recommend you PL/SQL of Steven Feuerstein, programming books - starting with "Oracle PL/SQL Programming" - they are very clear, use step by step explanations syntax and correct usage and I think I have more information on the net that you can download to use with examples in the book. I learned all that I know (PL/SQL) Steven. This can reduce the confusion see several examples that have discrepancies in the documentation.

    Good luck!

  • see my db in Java DB

    Hi all!

    I use netbeans.

    I use the reader of derby.

    I don't see my db that I created with this method:
          Class.forName("org.apache.derby.jdbc.EmbeddedDriver";);
    
           con = DriverManager.getConnection("jdbc:derby:"+getDBSystemDir()+";create=true;user=demo;password=demo");
    
       con.commit();
    [/code]
    All works fine from the code and from  code I can get all the tables but I cant see my db in Services->Databases->Java DB
    
    how can I fix it?
    thanks for helping                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Well maybe Netbeans is interested in a different database then. Print the url you pass to getConnection() in your code and compare which uses the code for what you have configured in Netbeans.

  • Recsurive Query

    Version: Oracle 11.2...

    I have table Date_test as follows

    create table date_test (x archer (3), the date of the start_dt, the date of end_dt);

    insert into date_test values ('AC',TO_DATE('01-JAN-2010','DDS-MON-KY'),TO_DATE('05-JAN-2010','DDS-MON-KY'));

    Commit;

    {code

    with dt (x, dt, end_dt) as
    (select x, start_dt, date_test end_dt
    Union of all the
    Select dt + 1, dt end_dt x where
    end_dt > = dt + 1).
    Select * DT

    }

    When executing the above query, I get the following error

    ORA-01841: (full) year must be between-4713 and 9999 and not 0

    Please help on this.

    Published by: charline on October 13, 2010 17:19

    When executing the above query, I get the following error

    Unfortunately WITH recursive clause with dates is extremely bug: see Re: query clause recurisve

  • MATH SQL client access licenses

    Hello

    I have a chart with lines more million. In this table, I have a lot of members associated with 60-70 facility_names.
    Unique index is on CMPNY, FNAME, M_ID MONTHS.

    Below, I have some EXAMPLES OF 3 facilities, ADIOS DAOMATO, NADA CAPETOWN and NADA NEW DIAMONDS.

    These companies have two different contract.

    For example, NADA CAPETOWN & NADA NEW DIAMOND
    -As soon as total Amount_1 CDA for a member associated with above facilities will more $2,000 and total Amount_2 passes over $4000, installation gets insurance protection for 90% of the sum, he surpassed in each categories.

    In example below, M0001 of NADA CAPETOWN, CDA AMOUNT_1 total more than $2,000 to 1 October 2009 (total $2160), installation gets recoveries of $144 ((2160-2000) * 90%).
    Similarly, in November 1, 2009, total of CDA is $2180 and installation gets recoveries of $18 ((2180-2160) * 90%). I subtracted $2160 because installation has already received $144 for having exceeded $160, more than 2000 back on October 1, 2009.

    Very similar, total if Amount_2 CDA exceeds 4000, TI $ receives 90% of the amount after $4000. (the calculations are the same as above)
    The column of recoveries should summarize recoveries exceed amount_1 and amount_2 per month.

    During this time,.

    ADIOS DAOMATO has a different contract. When single member of this facility (CDA AMOUNT_1 + AMOUNT_2 CDA) is greater than 5000, the plant recovers 90%.

    In the case of sum CDA Member Unique of ADIOS DAOMATO of AMOUNT_1 & AMOUNT_2 (combined) will more than $5,000, then installation gets insurance protection for 90% of the amount it exceeded.
    In the example below, total ADIOS DAOMATO CDA exceeds $5,000 to $ 20 (total YTD $ 5020) on January 1, 2009, so installation retrieves ((5590-5000$) * 90%) = $531. After months of November 1, 2009, $270 (90 $ + $180) added more than $5,000, so installation recoveres ((5860 $-$5590) * 90%) = $243... Similar calculation for every month.


    * I don't mind saw these two distinct processes. Please note that the calculation of recoveries ($) are by a single member of the installation by month/year, but the result should be to ease a month. So far I have annually. But I really need every month for financials.*

    Purpose: I need to know what level of insurance protection the installation receives monthly.
    For the duration of the contract 1 the Reisurance Total must be entered in the column "RECOVERIES" (COLLECTIONS of REINSURANCE OF AMOUNT_1 + the RECOVERIES of REINSURANCE OF AMOUNT_2).

    For the duration of the contract 2, there is only 1 recovery mode.

    As the I mentioned, that's a CALCULATION for a YEAR when the year changes, everything resets all members. *
    _ I would greatly appreciate your help. _

    Using oracle 10g
    DROP TABLE PAYMENT_1;
    
    create table PAYMENT_1
    (CMPNY      VARCHAR2(4),
     F_NAME          VARCHAR2(100),
     M_ID               VARCHAR2(8),
     MONTH         DATE,
     AMOUNT1    FLOAT(126),
     AMOUNT2    FLOAT(126)
     );
     
     INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0002','01-JAN-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0002','01-JAN-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-JAN-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-FEB-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-FEB-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-JUL-2009','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-AUG-2009','500','2000');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0002','01-AUG-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0002','01-OCT-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-OCT-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-NOV-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-DEC-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-DEC-2009','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0002','01-DEC-2009','500','2000');
    
    
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0001','01-JAN-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0001','01-JAN-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-JAN-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-FEB-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-FEB-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-JUL-2009','1200','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-AUG-2009','500','2200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0001','01-AUG-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN', 'M0001','01-OCT-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-OCT-2009','100','220');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-NOV-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-DEC-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-DEC-2009','1100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN', 'M0001','01-DEC-2009','500','2200');
    
    
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-JAN-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-JAN-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-JAN-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-FEB-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-FEB-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-JUL-2009','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-AUG-2009','500','2000');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-AUG-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-OCT-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-OCT-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-NOV-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-DEC-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-DEC-2009','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-DEC-2009','500','2000');
    
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN','M0004','01-JAN-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN','M0004','01-JAN-2010','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-JAN-2010','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-FEB-2010','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-FEB-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-JUL-2010','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-AUG-2010','500','2000');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN','M0004','01-AUG-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA CAPETOWN','M0004','01-OCT-2010','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-OCT-2010','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-NOV-2010','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-DEC-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-DEC-2010','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA CAPETOWN','M0004','01-DEC-2010','500','2000');
    
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-JAN-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-JAN-2010','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-JAN-2010','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-FEB-2010','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-FEB-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-JUL-2010','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-AUG-2010','500','2000');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-AUG-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','NADA NEW DIAMOND','M0003','01-OCT-2010','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-OCT-2010','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-NOV-2010','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-DEC-2010','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-DEC-2010','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','NADA NEW DIAMOND','M0003','01-DEC-2010','500','2000');
    
    
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','ADIOS DAOMATO','M0010','01-JAN-2009','20','5000');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','ADIOS DAOMATO','M0010','01-JAN-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-JAN-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-FEB-2009','30','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-FEB-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-JUL-2009','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-AUG-2009','500','2000');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','ADIOS DAOMATO','M0010','01-AUG-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2) VALUES ('C001','ADIOS DAOMATO','M0010','01-OCT-2009','90','180');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-OCT-2009','100','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-NOV-2009','20','20');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-DEC-2009','20','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-DEC-2009','1000','200');
    INSERT INTO PAYMENT_1 (CMPNY, F_NAME, M_ID, MONTH, AMOUNT1, AMOUNT2)VALUES ('C001','ADIOS DAOMATO','M0010','01-DEC-2009','500','2000');
    
    commit;
    
    
    --RESULTS SHOULD BE SOMETHING LIKE THE FOLLOWING
    
    DROP TABLE PAYMENT_2;
    
    create table PAYMENT_2
    (CMPNY      VARCHAR2(4),
     F_NAME          VARCHAR2(100),
      RECOVERIES     FLOAT(126),
     MONTH         DATE
     );
     
    
    
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','ADIOS DAOMATO','486','01-OCT-2009');
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','ADIOS DAOMATO','36','01-NOV-2009');
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','ADIOS DAOMATO','3528','01-DEC-2009');
    
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','NADA CAPETOWN','144','01-OCT-2009');
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','NADA CAPETOWN','18','01-NOV-2009');
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','NADA CAPETOWN','6786','01-DEC-2009');
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','NADA CAPETOWN','3150','01-DEC-2010');
    
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','NADA NEW DIAMOND','531','01-JAN-2009');
    INSERT INTO PAYMENT_2 (CMPNY, F_NAME, RECOVERIES, MONTH) VALUES ('C001','NADA NEW DIAMOND','243','01-FEB-2010');
    
    
    so forth.....
    
    commit;
    
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Hello

    Don't know how you map with strategies of recovery... the query below calculate the two 3 types for each facility.
    I give the floor:
    -rec1 one calculated as 90% of the amount1 above 2000
    -rec2 one calculated as 90% of the amount2 above 4000
    -rec3 one calculated as 90% of the sum (amount1, amount2) greater than 5000

    SQL> select
      2  cmpny,
      3  f_name,
      4  0.9*(greatest(2000,rollsum1) - greatest(2000,nvl(prevr1,0))) rec1,
      5  0.9*(greatest(4000,rollsum2) - greatest(4000,nvl(prevr2,0))) rec2,
      6  0.9*(greatest(5000,rollsum3) - greatest(5000,nvl(prevr3,0))) rec3,
      7  month
      8  from (
      9       select
     10       cmpny,
     11       f_name,
     12       lag(rollsum1) over (partition by cmpny, f_name, trunc(month,'year') order by month) prevr1,
     13       rollsum1,
     14       lag(rollsum2) over (partition by cmpny, f_name, trunc(month,'year') order by month) prevr2,
     15       rollsum2,
     16       lag(rollsum3) over (partition by cmpny, f_name, trunc(month,'year') order by month) prevr3,
     17       rollsum3,
     18       month
     19       from (
     20            select
     21            CMPNY,
     22            F_NAME,
     23            sum(s1) over (partition by cmpny, f_name, trunc(month,'year') order by month) rollsum1,
     24            sum(s2) over (partition by cmpny, f_name, trunc(month,'year') order by month) rollsum2,
     25            sum(s3) over (partition by cmpny, f_name, trunc(month,'year') order by month) rollsum3,
     26            month
     27            from (
     28                 select cmpny, f_name, month, sum(amount1) s1, sum(amount2) s2, sum(amount1+amount2) s3
     29                 from payment_1
     30                 group by cmpny, f_name, month
     31            )
     32       )
     33  )
     34  order by CMPNY, F_NAME, month ;
    
    CMPN F_NAME                     REC1       REC2       REC3 MONTH
    ---- -------------------- ---------- ---------- ---------- ------------
    C001 ADIOS DAOMATO                 0       1242        531 01-JAN-09
    C001 ADIOS DAOMATO                 0        198        243 01-FEB-09
    C001 ADIOS DAOMATO                 0        180       1080 01-JUL-09
    C001 ADIOS DAOMATO                 0       1980       2448 01-AUG-09
    C001 ADIOS DAOMATO                 0        342        513 01-OCT-09
    C001 ADIOS DAOMATO                 0         18         36 01-NOV-09
    C001 ADIOS DAOMATO              1359       2160       3528 01-DEC-09
    C001 NADA CAPETOWN                 0          0          0 01-JAN-09
    C001 NADA CAPETOWN                 0          0          0 01-FEB-09
    C001 NADA CAPETOWN               630          0          0 01-JUL-09
    C001 NADA CAPETOWN               936       2340       4806 01-AUG-09
    C001 NADA CAPETOWN               342        702       1044 01-OCT-09
    C001 NADA CAPETOWN                36         36         72 01-NOV-09
    C001 NADA CAPETOWN              2826       4500       7326 01-DEC-09
    C001 NADA CAPETOWN                 0          0          0 01-JAN-10
    C001 NADA CAPETOWN                 0          0          0 01-FEB-10
    C001 NADA CAPETOWN                 0          0          0 01-JUL-10
    C001 NADA CAPETOWN                 0          0          0 01-AUG-10
    C001 NADA CAPETOWN                 0          0        486 01-OCT-10
    C001 NADA CAPETOWN                 0          0         36 01-NOV-10
    C001 NADA CAPETOWN              1350       1800       3528 01-DEC-10
    C001 NADA NEW DIAMOND              0          0          0 01-JAN-09
    C001 NADA NEW DIAMOND              0          0          0 01-FEB-09
    C001 NADA NEW DIAMOND              0          0          0 01-JUL-09
    C001 NADA NEW DIAMOND              0          0          0 01-AUG-09
    C001 NADA NEW DIAMOND              0          0        486 01-OCT-09
    C001 NADA NEW DIAMOND              0          0         36 01-NOV-09
    C001 NADA NEW DIAMOND           1350       1800       3528 01-DEC-09
    C001 NADA NEW DIAMOND              0          0          0 01-JAN-10
    C001 NADA NEW DIAMOND              0          0          0 01-FEB-10
    C001 NADA NEW DIAMOND              0          0          0 01-JUL-10
    C001 NADA NEW DIAMOND              0          0          0 01-AUG-10
    C001 NADA NEW DIAMOND              0          0        486 01-OCT-10
    C001 NADA NEW DIAMOND              0          0         36 01-NOV-10
    C001 NADA NEW DIAMOND           1350       1800       3528 01-DEC-10
    
    35 rows selected.
    

    There might be a way more simple (I'm not very familiar with analytics).
    Do not know how it will behave with several million rows...

  • Determine a value for each record for the whole group

    < < Sorry I pasted erroneous results earlier > >

    Hello

    I have a table (in production, join the many tables, but for simplicity, I created a table), which has a few related accounts grouped by ACCT_GRP_ID I have to write a SQL (not a PL/SQL), who should have all columns of this table and an extra column "FLAG". For GA_CD = BBC, FLAG must have a value of 'No Show', if the APP_DT of at least a recording with the group is less than the current year also all the records in the group will have a value of 'Show '. For the record no BBC FLAG must always be 'Show '.

    DDLS
    {code}
    CREATE TABLE ACCOUNTS
    (NUMBER OF ACCT_GRP_ID,
    GA_CD VARCHAR2 (10),
    AGNT_NAME VARCHAR2 (50).
    NUMBER OF CASE_NUM
    NUMBER OF FUND_AMT
    DATE OF APP_DT,
    STATUS VARCHAR2 (10));

    INSERT INTO ACCOUNT VALUES (1, 'BBC', 'SAMANTHA, JOSE, 12345, 234.33, 2 AUG 2008', ' PLACED');
    INSERT INTO ACCOUNT VALUES (1, 'BBC', 'SAMANTHA, JOSE, 12346, 331,13, 24 APR 2009', ' PLACED');
    INSERT INTO ACCOUNT VALUES (1, 'BBC', 'SAMANTHA, JOSE, 12347, 201,27, 13 FEB 2009', ' PLACED');
    INSERT INTO ACCOUNT VALUES (2, 'BBC', ' MARK, ROSS, 12348, 98.12, 31 MAY 2009', 'PLACE' ");
    INSERT INTO ACCOUNT VALUES (2, 'BBC', ' MARK, ROSS, 12349, 121.00, 25 JUNE 2009', 'PLACE' ");
    INSERT INTO ACCOUNT VALUES (2, 'BBC', 'BRAND, ROSS, 12350, 11.00, 27 JUNE 2009', 'CLOSED');
    INSERT INTO ACCOUNT VALUES (3, 'BBC', "RAJ MALIK", 12351, 89.00, 31 DEC 2008', 'PLACED');
    INSERT INTO ACCOUNT VALUES (3, 'BBC', "RAJ MALIK", 12352, 22.00, 26 OCT 2008', 'PLACED');
    INSERT INTO ACCOUNT VALUES (4, 'BBC', 'SHANE, WILLS', 12353, 443.00, 7 JUNE 2009', 'PLACE');
    INSERT INTO ACCOUNT VALUES (5, 'BBC', 'JANE, WALLACE, 12354, 74.00, 17 JAN 2009', ' PLACED');
    INSERT INTO ACCOUNT VALUES (NULL, 'BBC', 'ROSY, BETH', 12355, 124.00, 21 MAR 2009', 'PLACE');
    INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'TINA, WZWICK', 22330, 89.00, 31 DEC 2008', 'PLACED');
    INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'YANA, KORVIN', 27351, 22.00, 26 OCT 2008', 'PLACED');
    INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'SARA, YUI', 22352, 443.00, 7 JUNE 2009', 'PLACE');
    INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'MIKE, TROY, 22453, 74.00, 17 JAN 2009', ' PLACED');

    COMMIT;
    {code}

    Required result:
    {code}
    APP_DT GA_CD AGNT_NAME STATE BOITE_ FUND_ ACCT_ INDICATOR
    AMT NUM GRP_ID
    1 SAMANTHA, JOSE PLACE 12347 201.27 BBC 13/02/2009 no show
    1 SAMANTHA, JOSE PLACE 12346 331.13 BBC 24/04/2009 no show
    1 SAMANTHA, JOSE PLACE 12345 234.33 BBC 08/02/2008 no show
    MD2 BBC BRAND, ROSS CLOSED 12350 11 6/27/2009 see the
    MD2 BBC BRAND, ROSS PLACED 12349 121 6/25/2009 see the
    2 BRAND of BBC, ROSS PLACE 12348 98.12 show of 31/05/2009
    3 BBC RAJ MALIK not PLACED 12352 22 10/26/2008 no show
    3 BBC RAJ MALIK not PLACED 12351 89 12/31/2008 no show
    4 BBC SHANE, WILLS PLACE 12353 443 6/7/2009 see the
    5 BBC JANE, WALLACE PLACE 12354 74 1/17/2009 see the
    STARS of MIKE, TROY PLACED 22453 74 1/17/2009 see the
    See the BBC ROSE, BETH PLACED 12355 124 3/21/2009
    STAR SARA, YUI PLACED 22352 443 6/7/2009 see the
    TINA, WZWICK STAR PLACED 22330 89 12/31/2008 see the
    YANA STAR, KORVIN PLACED 27351 22 10/26/2008 see the
    {code}

    As in the results Group 1 has a record with the date of 2008 for the whole group getting 'No Show'. Group 2 has all the records this year, so he gets the 'Show '.
    Help, please!

    Published by: Kuul13 on June 25, 2009 13:31

    Published by: Kuul13 on June 25, 2009 13:43
    I think I'm really having a BAD BAD day... Sorry again... I don't need the domain TOT_FUND_AMT...

    Hello

    Thanks for posting the DDL and DML statements. This helps a lot.

    I don't understand the output, however. Do you want to really two rows of output for each row in the table? The tot_fund_amt is copied from somewhere else? More important still, the results do not include the new flag column. Isn't the point of all of this question? It's good to describe how the indicator is calculated, but you have to show, too.

    I think you want analytical MIN function to find the first app_dt in each group, like this:

    SELECT  a.*
    ,     CASE
              WHEN  ga_cd = 'BBC'
              AND   MIN (app_dt) OVER ( PARTITION BY  ga_cd
                                          ,              acct_grp_id
                                        )  < TRUNC (SYSDATE, 'YYYY')
                    THEN  'No Show'
                    ELSE  'Show'
         END     AS flag
    FROM     accounts   a
    ;
    

    Output:

    . ACCT
      _GRP GA                     CASE     FUND
       _ID _CD  AGNT_NAME         _NUM     _AMT APP_DT     STATUS FLAG
    ------ ---- --------------- ------ -------- ---------- ------ -------
         1 BBC  SAMANTHA, JOSE   12345   234.33 08/02/2008 PLACED No Show
         1 BBC  SAMANTHA, JOSE   12346   331.13 04/24/2009 PLACED No Show
         1 BBC  SAMANTHA, JOSE   12347   201.27 02/13/2009 PLACED No Show
         2 BBC  MARK, ROSS       12348    98.12 05/31/2009 PLACED Show
         2 BBC  MARK, ROSS       12349   121.00 06/25/2009 PLACED Show
         2 BBC  MARK, ROSS       12350    11.00 06/27/2009 CLOSED Show
         3 BBC  RAJ, MALIK       12351    89.00 12/31/2008 PLACED No Show
         3 BBC  RAJ, MALIK       12352    22.00 10/26/2008 PLACED No Show
         4 BBC  SHANE, WILLS     12353   443.00 06/07/2009 PLACED Show
         5 BBC  JANE, WALLACE    12354    74.00 01/17/2009 PLACED Show
           BBC  ROSY, BETH       12355   124.00 03/21/2009 PLACED Show
           STAR TINA, WZWICK     22330    89.00 12/31/2008 PLACED Show
           STAR SARA, YUI        22352   443.00 06/07/2009 PLACED Show
           STAR MIKE, TROY       22453    74.00 01/17/2009 PLACED Show
           STAR YANA, KORVIN     27351    22.00 10/26/2008 PLACED Show
    

    Note that the NULL acct_grp_id is a group. PARTITION BY acct_grp_id is of course necessary, but we must also, PARTITION BY ga_cd all non-BBC lines will be included in this group. In other words, we are unwilling reported as 'No Show', all ROSY just because TINA or JANA had an early app_dt.

  • GPIB write error code 6, how to make good waiting in comm GPIB

    Hello!

    I use a MUX Keithley and a digital Voltmeter to measure different values in my system, including the resistance of the wire 4. My project runs for several hours without any problem, but last night I got an error after about 8 hours DURATION. My mistake in the main vi shows the following error:

    GPIB Write in A_4Wire_resMUX_2!1,2!3,2!5_new.vi Error code 6.
    

    I have attached this Subvi, as you can see, I put a while loop in the Subvi to give enough time to measure 4 son to do. But of course maybe another function GPIB write hangs in the Subvi, not that after the while loop.

    I have 2 questions:

    1. What is the best way to make the error handling in comm GPIB, so I could see on my final mistake on what caused the problem in this certain sub - VI?

    2. can someone show me what I could do better in this sub - VI, in order to avoid possible errors of GPIB?

    Its just guessing, but I think the error comes from that I can't give enough time to the GPIB device to perform an action, then the next writing of GPIB breaks down?

    more information: Windows XP, LabView 2010 full version

    Thanks much for the advice and help!

    2001 pilot

    7001 driver

    Now that you have a modern version of LabVIEW why are you not taking advantage of the instrument driver network?  VISA is beautiful and 488,2 gross primitives should consider as "obsolete".

    Since you did not use the specific instrument driver vi we cannot say that write on this device generates the error that you are experiencing.

    So to specifically answer to Q1.  Use the driver found on the instrument driver network - they are tested and structured in a way to help debug your application and to take advantage of the powerful features of VISA...

    And (2) (see #1) and change the sequence stacked in a state machine

  • looking to purchase a copy of the elements after the trial. However, basket indicates platform: Windows. I need for Mac. Before I commit the activation code will work for the Mac. Impossible to find anywhere on the Web site to buy different versions.

    looking to purchase a copy of the elements after the trial. However, basket indicates platform: Windows. I need for Mac. Before I commit the activation code will work for the Mac. Impossible to find anywhere on the Web site to buy different versions.

    Hi Mljohno,

    If you search for items 14, go into products from Adobe, click on 'Buy' in front of the name of the product and use the drop down menus to specify Mac or Windows full version or upgrade.

    Best,

    Del

  • Replace the comma with the liquid matrix code

    Hey people,

    I might not even wrong terminology, but I'm stumped on this question.

    I have a picture of an element of app web listbox that out puts the following liquid on the DETAILS page:

    "Fuel products': 'Diesel (high-speed), Premium ULP, ULP regularly."

    I am willing to spend the commas in the table with an icon of fonts, for example:

    < span class = "find the fa - fa" > < / span >

    I tried using the 'Replace' filter but it does not work. And I tried to use "capture", but there is clearly a funky coding that I completely missed. Help, please...

    {capture check %} < span class = "find the fa - fa" > < / span > {% endcapture}}

    {{it. ["Products of fuel"] | {{replace: ",", "{{tick}}"}}

    See you soon

    James - RelianceIT

    Hello

    Try {{this. [' Fuel products] | {{replace: "," check mark}}

    and let us know if it works.

    Thank you

    M

  • How do I solve the NonPersistableObjectException

    I have a method that is simple, written in the form:

    Public Shared Sub set (long uniqueId, String value) {}
    Store = PersistentStore.getPersistentObject (uniqueId);
    synchronized (store) {}
    store.setContents (value);
    Store.Commit ();
    }
    }

    This method works very well for the first time, but the second time, it will fail with NonPersistableObjectException.

    Point to be noted is that same unique identification number, I'm updating with the same value.

    You have created an object that extends the string that you store?  If so, you will need to implement Persistable in this object.

    Your own object is also a good idea.  But there is a problem with persistent objects when you upgrade the.  Say, you create an object as follows:

    class MyPersistentObject extends Persistable {}

    String _string1 = null;

    String _string2 = null;

    ....

    String getString1() {}

    Return _string1;

    }

    ...

    }

    Now for V2, you want to add another string, so you must

    class MyPersistentObject extends Persistable {}

    String _string1 = null;

    String _string2 = null;

    String _string3 = null;

    ....

    String getString3() {}

    Return _string3;

    }

    ...

    }

    Now because you have changed the structure of this persistent object, you actually have the persistent class on the incompatible device with your upgrade.  To install, users will have to delete the old application, lose the stored data.

    However if you did to begin with:

    class myPersistedObject extends IntHashTable implements Persistable {}

    ...

    String getString1() {}

    Return this.get (1);

    }

    ....

    }

    Then to add another channel, you simply add the get method:

    class myPersistedObject extends IntHashTable implements Persistable {}

    ...

    String getString3() {}

    Return this.get (3);

    }

    ....

    }

    The structure does not change and it is compatible.

    The above code is NOT correct, I hope you get the idea.

    Then create your own class, but extends a Collection object and you get the flexibility and scalability.

    Hope it makes sense.

  • NonPersistableObjectException

    Hi people,

    I get this error on the subject, when I try to open an httpconnection, strange isn't? rsrs... under my PersistenceClass:

    [code]

    package mypackage;
    import net.rim.device.api.system.PersistentObject; import net.rim.device.api.system.PersistentStore;
    Class DataPersistance {}
    Private Shared DataPersistance dataPersistance;    private static PersistentObject persistentObject.    settingsTable private static Hashtable;
    Continue the implementation... private DataPersistance() {}
    Hash of examples.persistentstore.
    persistentObject = PersistentStore.getPersistentObject (0xc80c1e32);
    {Synchronized (persistentObject)}
    settingsTable = persistentObject.getContents () (Hashtable);        If (null == settingsTable) {settingsTable = new Hashtable();            persistentObject.setContents (settingsTable);            persistentObject.commit ();        }        // }    }
    public {get {Object (String key) {/ / settingsTable = persistentObject.getContents () (Hashtable);}}}        Return settingsTable.get (key);    }
    public void set (String key, Object value) {if (value == null) {settingsTable.remove (key);}        } else {settingsTable.put (key, value);        }
    }
    public void commit() {try {synchronized (persistentObject) {persistentObject.setContents (settingsTable);}                persistentObject.commit ();            }
    } catch (System.Exception e) {e.printStackTrace ();            System.out.println ("PERSISTENCE of EXCEPTION:" + e.getClass () + "" + e.getMessage ());        }    }
    public static DataPersistance getInstance() {if (dataPersistance! = null) {System.out.println ("retornando um DataPersistance ja existente.");}            Return dataPersistance;        } else {System.out.println ("instanciando um DataPersistance.");            dataPersistance = new DataPersistance();            Return dataPersistance;        }    }
    }

    [/ code]

    Why get this error on a COnnection.open? I don't have to commit to anything, don't getContents();

    Thank you

    I am very confused.  If you don't keep all objects, so how can you have a NonPersistableObjectException?

    We see in the code that you create an empty hash table and it is persistent.  Hashtable is persistent.  So this will not cause your problem.  So it seems logical that you have in fact, directly or not, add an object to the list of objects to be persisted.  You can do this without knowing it.  If you add the object to the hash table and object has a reference to object B, then it will also persist object B.  A, otherwise it won't be able to recreate the object A.  Now maybe object A is Persistable (like the hash table) but is not object B.  This causes the problem.

    So, as I said before you have to go through all the ' together do you and know what objects you are directly and indirectly adding to PersistentStore.

    I have another change of code to suggest that, in my opinion, could well help to find this problem.  in your

    Public Sub set (...)

    method, add a call to commit.  This will attempt to commit as soon as you add an object.  And you will likely (but not guaranteed to be 100%) to have this failure on the object that you add, and that is not persistent.

    I do not understand why you have given us your connection class.  What is there to do with the problem?

    Finally, if you hover over the icons in the tool bar layout you see when you create a message, you will see tooltips.  Icons will say "Insert Code".  Press and paste the code into the window that opens.  Do it after you have checked your post, as it used to be that the spellcheck spoiled some of the formatting of the code.

  • SD card works no-error code 39 on my Satellite A series

    SD CARD IS NOT VISIBLE WHEN INSERTED. POSTER CORRUPTED DRIVER (CODE 39) DEVICE MANAGER

    SOME OF MY DEVICES DO NOT WORK IN THE USB HUBS. DEVIVE MANAGER SHOWS THAT:

    INTEL R ICH8 FAMILY USB 2830 AT 2835 ARE CORRUPTED (CODE 39)

    I WAS WONDERING IF ANYONE HAD EXPERIENCED THESE PROBLEMS BEFORE?

    THANK YOU FOR HEPLPING IN ADVANCE

    Hello

    I m wondering why do you use always capitalized?
    Is it so difficult to use the single characters, commas, points, etc.?

    Back to your question;
    What model phone you have and which Win OS have been installed?

    My first thought was that this problem happened because some drivers are not installed or has stopped working!
    That's why I recommend reinstalling the Chipset driver (utility) and the card reader driver (driver SD card?)

    See the European driver of Toshiba page and there you can find the necessary drivers!

    Good bye

Maybe you are looking for

  • Firefox crashes at startup upward. tried to uninstall it. andreinstall crashes at startup... .even but starts in safe mode...

    Firefox 3.6 tracks great .but when I install 4 all that is this crash when it starts. do you have a complete uninstall. and then delete all files in firefoxthen firefox installed on a 2nd drive... to see if that would help. stop crashing when it star

  • Need advice on the Satellite Pro M40

    I wonder if someone could advise me. We just bought 8 smart tips for our school with these I ordered 8 portable computers SatProM40. When I ordered them I checked the spec as follows Toshiba SatProM40 - Celeron M360 1.4 GHz - RAM 256 MB - HD 40 GB-CD

  • HP d004tu: controller x 64 d004tu network driver

    Dear Sir/Madam, I use Windows 7 Home Premium on my laptop and I am currently not able to connect to the internet. I looked up the Device Manager and found that the drivers of network controller is missing. Where can I find the drivers? Thanks for the

  • Custom notifications and ringtones not available more

    I can't take when this happened, but it was last week, but custom notification and the ringtone that I put restore the default values, and the phone is no longer see them in the list. Initially they sounds (mp3 and wav) were in directories in the mai

  • Color text printed in black only

    Dear all, I have a printer - HP Officejet 6000 E609a series, which has been working well for a few days. When I try to print the color of text, the text is printed in black. Lines, shapes, images to print in good color but not the text. However, if I