How to do the validation to the record level in multi record block.

Hello
I use form 10g. I have a doubt in form 10g. Look, I got multi-record block (10 records).
In this block, I have a few items of text
(1) S_NO
Account_number 2)
withdraw_amt 3)
Deposit_amt 4)
(5) balance_amt.

These are the fields and sample data that I posted in forms.
S. n ACC_No - WITHDRAW_AMT - DEPOSIT_AMT - BALANCE_AMT
1-250 - 1000.00 - 1000.00
2.------250-----------500.00-------------------------------------------500.00
3-250 - 2000.00 - 2500.00


Now, I entered the data manually in all areas...
But what I need is if I entered the field of deposit in the amount it will add to the old balance and if I add the amount to remove the field that he removed from the old balance automatically.
Pls tell me what are the possible ways to implement this form...


Eliane.

For the calculation of the fields there are some properties, you can define and then let the calculation forms. The WHEN-VALIDATE-POINT-approach will not work, because it increases your balance_amount whenever you change the value.

But what exactly is the logic for your calculation. It's just: BALANCE_AMT =: DEPOSIT_AMT-: WITHDRAW_AMT?

If so, create a new database item not in the block, assign Calcaulation-mode of 'Formula', a formula to something like

NVL(:BLOCK.DEPOSIT_AMT,0)-NVL(:BLOCK.WITHDRAW_AMT)

Then whenever you change DEPOSIT_AMT or WITHDRAW_AMT, the BALANCE_AMT will be calculated again.

Tags: Oracle Development

Similar Questions

  • LOBs and how to retrieve the record inserted with EMPTY_BLOb()

    Hi guys


    How to retrieve the records inserted with EMPTY_BLOb() instead of NULL value.


    Best greetings
    A.G.

    There must be a better way, but these work:

    SELECT... from tableX where length (lob_column) = 0;
    SELECT... from tableX where dbms_lob.getlength (lob_column) = 0;

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "All experts it is a equal and opposite expert."
    Clarke

  • How to find the child level for each table in a relational model?

    Earthlings,

    I need your help, and I know that, "Yes, we can change." Change this thread to a question answered.

    So: How to find the child level for each table in a relational model?

    I have a database of relacional (9.2), all right?
    .
         O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */
        /↑\ Fks
       O"O O" <-- level 2 for first table (circle)
      /↑\ Fks
    "o"o"o" <-- level 1 for middle table (circle)
       ↑ Fk
      "º"
    Tips:
    -Each circle represents a table;
    -Red no tables have foreign key
    -the picture on the front line of tree, for example, a level 3, but when 3 becomes N? How is N? That is the question.

    I started to think about the following:

    First of all, I need to know how to take the kids:
    select distinct child.table_name child
      from all_cons_columns father
      join all_cons_columns child
     using (owner, position)
      join (select child.owner,
                   child.constraint_name fk,
                   child.table_name child,
                   child.r_constraint_name pk,
                   father.table_name father
              from all_constraints father, all_constraints child
             where child.r_owner = father.owner
               and child.r_constraint_name = father.constraint_name
               and father.constraint_type in ('P', 'U')
               and child.constraint_type = 'R'
               and child.owner = 'OWNER') aux
     using (owner)
     where child.constraint_name = aux.fk
       and child.table_name = aux.child
       and father.constraint_name = aux.pk
       and father.table_name = aux.father;
    Thought...
    We will share!

    Thanks in advance,
    Philips

    Published by: BluShadow on April 1st, 2011 15:08
    formatting of code and hierarchy for readbility

    Have you looked to see if there is a cycle in the graph of dependence? Is there a table that has a foreign key to B and B has a back of A foreign key?

    SQL> create table my_emp (
      2    emp_id number primary key,
      3    emp_name varchar2(10),
      4    manager_id number
      5  );
    
    Table created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create table my_mgr (
      2    manager_id number primary key,
      3    employee_id number references my_emp( emp_id ),
      4    purchasing_authority number
      5* )
    SQL> /
    
    Table created.
    
    SQL> alter table my_emp
      2    add constraint fk_emp_mgr foreign key( manager_id )
      3         references my_mgr( manager_id );
    
    Table altered.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1   select level lvl,
      2          child_table_name,
      3          sys_connect_by_path( child_table_name, '/' ) path
      4     from (select parent.table_name      parent_table_name,
      5                  parent.constraint_name parent_constraint_name,
      6                  child.table_name        child_table_name,
      7                  child.constraint_name   child_constraint_name
      8             from user_constraints parent,
      9                  user_constraints child
     10            where child.constraint_type = 'R'
     11              and parent.constraint_type = 'P'
     12              and child.r_constraint_name = parent.constraint_name
     13           union all
     14           select null,
     15                  null,
     16                  table_name,
     17                  constraint_name
     18             from user_constraints
     19            where constraint_type = 'P')
     20    start with child_table_name = 'MY_EMP'
     21*  connect by prior child_table_name = parent_table_name
    SQL> /
    ERROR:
    ORA-01436: CONNECT BY loop in user data
    

    If you have a cycle, you have some problems.

    (1) it is a NOCYCLE keyword does not cause the error, but that probably requires an Oracle version which is not so far off support. I don't think it was available at the time 9.2 but I don't have anything old enough to test on

    SQL> ed
    Wrote file afiedt.buf
    
      1   select level lvl,
      2          child_table_name,
      3          sys_connect_by_path( child_table_name, '/' ) path
      4     from (select parent.table_name      parent_table_name,
      5                  parent.constraint_name parent_constraint_name,
      6                  child.table_name        child_table_name,
      7                  child.constraint_name   child_constraint_name
      8             from user_constraints parent,
      9                  user_constraints child
     10            where child.constraint_type = 'R'
     11              and parent.constraint_type = 'P'
     12              and child.r_constraint_name = parent.constraint_name
     13           union all
     14           select null,
     15                  null,
     16                  table_name,
     17                  constraint_name
     18             from user_constraints
     19            where constraint_type = 'P')
     20    start with child_table_name = 'MY_EMP'
     21*  connect by nocycle prior child_table_name = parent_table_name
    SQL> /
    
           LVL CHILD_TABLE_NAME               PATH
    ---------- ------------------------------ --------------------
             1 MY_EMP                         /MY_EMP
             2 MY_MGR                         /MY_EMP/MY_MGR
             1 MY_EMP                         /MY_EMP
             2 MY_MGR                         /MY_EMP/MY_MGR
    

    (2) If you try to write on a table and all of its constraints in a file and do it in a valid order, the entire solution is probably wrong. It is impossible, for example, to generate the DDL for MY_EMP and MY_DEPT such as all instructions for a table come first, and all the instructions for the other are generated second. So even if NOCYCLE to avoid the error, you would end up with an invalid DDL script. If that's the problem, I would rethink the approach.

    -Generate the DDL for all tables without constraint
    -Can generate the DDL for all primary key constraints
    -Can generate the DDL for all unique key constraints
    -Can generate the DDL for all foreign key constraints

    This is not solidarity all the DOF for a given in the file object. But the SQL will be radically simpler writing - there will be no need to even look at the dependency graph.

    Justin

  • How to show the ink levels on the computer for Officejet 6600

    How to show the ink levels on the computer for Officejet 6600

    What is the full product name or product number?

    is your printer?

    This is the Manual of your printer the following image was derived.

    You can use the printer's built-in web server to get the status of the printer information from a browser.

  • How to get the battery level and status in the cpp file?

    Hi all

    BatteryInfo class so I can I know how to get the battery level and the State in .cpp class?

    Hi Benecore,

    I have Add method below,

    #include

    But I only variable BatteryInfoPrivate not get variable BatteryInfo. You can also check on your side.

    So let me know how to get batteryInfo instance?

  • How to make the record value appear in the "Message of success of the process?

    Hello

    I have a page called process "insert" "On submit - after calculations" and Validations with the look of PL/SQL codes such as:

    Start
    insert into abc (col1) values (: P7_col1)
    end;

    In the "Message of success of the process", how can I include the record value (ie: P7_col1, say, it's "Item1") in the message so that it could look like:

    Item1 has been added successfully.

    Thank you very much
    Helen

    Published by: user4503001 on July 21, 2009 11:20

    Helen,

    Substitution variables must be written in capital letters, always.

    Scott

  • How to increase the recording time

    Initial term of the title: Recvord
    I would like to extend the recording time is included in XP. It will be released in 3 hours. How can I do that. If I can't do this, then how RIP with Media Player 11

    Initial term of the title: Recvord
    I would like to extend the recording time is included in XP. It will be released in 3 hours. How can I do that. If I can't do this, then how RIP with Media Player 11

    ================================
    XP Sound Recorder is limited to 60 seconds.

    The free Audacity software may be worth a try.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Audacity
    http://Audacity.sourceforge.NET/

    Recording with Audacity
    http://Audacity.sourceforge.net/manual-1.2/tutorial_basics_4.html

  • How to delete the record from the classic report?

    Hi all

    I am currently working in the APEX 4.2.5.

    I did a classic report and I want to click on the link 'delete' to remove the record.

    But how can I do this?

    Thanks in advance

    See this recent thread on the forum: https://community.oracle.com/thread/3687421?start=0&tstart=0

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • How to remove the record of termination for a partner who has been rehired

    Hello can someone please advice on the script below:

    Partner hired as an intern on January 30, 2010, associated was called on August 5, 2010

    Now associated hired as full-time on August 7, 2010, and is always used

    Technically associated has been named in the Organization but still worked. It seems that this has been done as dismissal rather than transfer.

    Now, there are affect the associated benefits and plan to leave because of a gap in the last hire date.

    Question: How can I do the related record as if it had never ended? Partner must thus hiring as January 30, 2010 last date and no cancellation after that.


    #1. If you use a pay-

    If it is for a past period and you run payroll since then, it is not possible.

    When you terminate a person, the assignment gets end date.

    So for this person the first assignment would have dated at the end on August 5, 2010.

    And when you have again hired the person on August 7, 2010, a new assignment with assignment_number XXXX-2 would have been created.

    And everything works payroll would have used the new record of assignment for calculations.

    So the only solution is to change the date of service on the form of the person stopped and use this date for benefits or calculations.

    #2. If you do not pay-

    Then you can cancel the last rental for the person, so the state changes to the former employee.

    And then reverse to end employment.

    This should undo all changes to the person.

    Depending on what you use and how old is the correction, you must make a decision.

    Hope that helps.

    See you soon,.

    Vignesh

  • How to insulate the record insertion on a block of other blocks

    Hi all

    I am facing a problem in inserting record on several blocks. Let suppose that there are three blocks A, B and C user is inserting record in the block in the user Meanwhile jumped to block B and inserting record start here and then commit those changes. Inserting record on block B is failed due to validation on block A, where user left between the two and jumped to block B and application form for incomplete registrations. However, on the block B, all elements are validated but still ask to enter data block has.

    It is possible that if the user enter the record in the current block and forms insert record in that block and validate any changes on other blocks. I tried insert_record; integrated into the insert record but did not work. An idea to get out of this situation that I would be grateful.

    Thank you.

    A form module is treated as a single unit of work or of a single transaction. Either you save all data in it or anything. If you have a logic which must be stored separately from each other, so you should design your modules accordingly, in your case, create different form-Modules for different blocks. Everything else will only cause problems and is not the way to form of work.

    Message geändert durch AndreasWeiden

  • How to use the record type as a parameter IN PL/SQL procedure or package

    Hi people,

    I need help on the record as the OUT parameter type. I am able to get out a single line as a parameter, but not getting do not idea how to get a multi ranks as output parameter.

    I have the code that works very well for a single line. Please see CODE1.

    But when I try to get several lines, I'm failing to do. Please see the CODE2. I get the error of compilation as


    Error report:

    ORA-06550: line 11, column 35:

    PLS-00487: Invalid reference to the variable "P_NAME.

    ORA-06550: line 11, column 1:

    PL/SQL: Statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    Any help or a sample execution of script would be really useful.

    Thanks in advance.

    YZ

    --------------------------CODE1------------------------------------------

    -------------------------Package Spec-------------------------------

    CREATE OR REPLACE

    PACKAGE xx_sample_pkg as

    --

    Xx_sample_table_rectype RECORD TYPE IS

    (p_name varchar2 (40))

    number of p_emp_id

    );

    PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);

    END xx_sample_pkg;

    ------------------------------Package Body------------------------

    create or replace

    PACKAGE xx_sample_pkg AS BODY

    --

    PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS

    BEGIN

    SELECT ename, empno

    IN xx_sample_rec1

    FROM scott.emp

    WHERE ename = 'SMITH ';.

    END xx_sample_prc;

    END xx_sample_pkg;

    -------------------------------------------Execute----------------------

    DECLARE

    l_rec_type xx_sample_pkg.xx_sample_table_rectype;

    BEGIN

    dbms_output.put_line ('xx_sample_prc appeal');

    xx_sample_pkg.xx_sample_prc (l_rec_type);

    dbms_output.put_line ('YZ' | l_rec_type.p_name |') '|| l_rec_type.p_emp_id);

    END;

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

    -------------------------CODE2-------------------------------------------

    -------------------------Package Spec-------------------------------

    CREATE OR REPLACE

    PACKAGE xx_sample_pkg as

    --

    Xx_sample_table_rectype RECORD TYPE IS

    (p_name varchar2 (40))

    number of p_emp_id

    );

    PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);

    END xx_sample_pkg;

    ------------------------------Package Body------------------------

    create or replace

    PACKAGE xx_sample_pkg AS BODY

    --

    PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS

    BEGIN

    SELECT ename, empno

    IN xx_sample_rec1

    FROM scott.emp;

    END xx_sample_prc;

    END xx_sample_pkg;

    -------------------------------------------Execute----------------------

    DECLARE

    l_rec_type xx_sample_pkg.xx_sample_table_rectype;

    BEGIN

    dbms_output.put_line ('xx_sample_prc appeal');

    xx_sample_pkg.xx_sample_prc (l_rec_type);

    for l_rec in 1.l_rec_type.p_name.count

    loop

    dbms_output.put_line ('YZ' | l_rec_type.p_name (l_rec) |) » '|| l_rec_type.p_emp_id (l_rec));

    end loop;

    end;

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

    bb8c573a-6ca3-4d7c-90ed-e55c2df67201 wrote:

    But now, my question would be why the record type could not be used? My understanding is missing some concept between use of type type array collection record vs. Please specify.

    Do not confuse the folder with the collection.

    SY.

  • How to display the records from a query in the non-base data field

    Hello

    I have a problem:
    I have a query with a lot of tables and column 6 (select a, b, c, d, e, f x, y, z, t, s, g where the conditions) and I use 3 parameters.
    I create 3 settings: datai,: dataf and: partner and a button with a trigger when the button is pressed.
    Then a create a block manually with six field non-database a1, b1, c1, d1, e1, f1.
    Now, I want to display all the records in my query in a1, b1, c1, d1, e1, f1 where a1 = a, b1 = b, etc. and all the records (if I have 20 record, it will display 20 records in the non-base data field) when I press the button.

    How I did it:
    I create a cursor with the query, and then
    start the open cursor
    loop
    Fetch cursor in: a1,: b1,: c1: d1: e1,: f1;
    end loop;
    close the cursor;
    end;

    It displays a single record in a1, b1, c1 only, and it must display 100 records and date for all fields.

    Can someone help me with this problem?
    Thank you.

    Published by: 928437 on October 1, 2012 02:55

    Creating a view and the query in a database block are a great solution.

    To use the block non-base of data:
    You are missing the most important Next_Record; command.

     Begin
    Go_block('X'); -- block X is the non-database block
    Clear_Block(No_Validate);
    open cursor X1;
    loop
    If :System.Record_status != 'NEW' then
    Next_Record;
    End if;
    fetch X1 into :a1,:b1,:c1,:d1,:e1,:f1;
    Exit when X1%NOTFOUND;
    end loop;
    close X1;
    end;

  • How to view the records per page 4

    Hello.
    How can I display multiple records per page in report 6i
    Suppose I have a page of A4 format, I need to show 4 records per page
    Like this
    .....................................................
    .     ..............        |     ..............         .
    .     .          .        |     .          .      .
    .     .  record A  .        |     .  record B  .      .
    .     .          .        |     .          .      .
    .     .               .        |     .               .      .
    .     ..............        |     ..............         .
    .                          |                        .
    .---------------------------------------------------.
    .                          |                        .
    .     ..............        |     ..............         .
    .     .          .        |     .          .      .
    .     .  record C  .        |     .  record D  .      .
    .     .          .        |     .          .      .
    .     .               .        |     .               .      .
    .     ..............        |     ..............         .
    .....................................................
    any idea?
    Thank you

    Hello
    Select the pull-out frame and set the print Direction across/down and set the records per Page Maximum 4 and Vertical and Horizontal variable elasticity. Then try to run your report.

    -Clément

  • How to share the record group between 2 forms

    Hi all

    Some might guide me how to send one record group to another form and how it is received

    programmaticaly

    any help or advice, that I enjoyed

    Thank you

    Hello
    Little late but was not on the development computer.
    In fact the data you are trying to recover also ensure the data type. I mean if you retrieve DIGITAL data record group for the first column you use fld_1 , you must have to use the built-in GET_GROUP_NUMBER_CELL . Like this..

    DECLARE
      rg_id recordgroup;
    BEGIN
      rg_id := FIND_GROUP('my_rg');
      IF NOT id_null(rg_id) THEN
       :ctrl.text_item8 := GET_GROUP_NUMBER_CELL('my_rg.fld_1', 1);
      END IF;
    END;
    

    If If the field you get the record group's CHARACTER then you must use the built-in function GET_GROUP_CHAR_CELL like that...

    DECLARE
      rg_id recordgroup;
    BEGIN
      rg_id := FIND_GROUP('my_rg');
      IF NOT id_null(rg_id) THEN
        :ctrl.text_item8 := GET_GROUP_CHAR_CELL('my_rg.fld_1', 1);
      END IF;
    END;
    

    And if the salvage value of DATE data type, then GET_GROUP_DATE_CELL like this...

    DECLARE
      rg_id recordgroup;
    BEGIN
      rg_id := FIND_GROUP('my_rg');
      IF NOT id_null(rg_id) THEN
        :ctrl.text_item8 := GET_GROUP_DATE_CELL('my_rg.fld_1', 1);
      END IF;
    END;
    

    So, in you case I think the department_id data type is numeric in the database, and you use GET_GROUP_CHAR_CELL which will not work. Use the first one I showed you for numeric values.

    And also use the trigger a TIME NEW FORM INSTANCE used to retrieve the value. I want to use the first example in this trigger. Then you can see the value of the result of the shared record group.

    -Clément

  • How to lock the record in the form?

    Hi all

    I want to lock the selected records in the time of the query. Let's say I want to lock the records in the Employee table. And I have a block of the base table (no view on screen) the employee and one table from another base block (display fields: Department code and the name of the Department, situation, number of employees on the screen) which is a summary of records selected in the Employee table.

    Now, I want to lock the records in the Employee table when run query so that some backend process cannot 'touch' the annals which are already displayed on the screen.

    I tried to put the ' SELECT '1' IN v_dummy FROM EMPLOYEE WHERE update_user =: B_CONTROL.c_user FOR UPDATE NOWAIT ' under the block trigger 'On-Lock' of base table. Then go to SQL * MORE to update the employee record. However, I can update the record successfully. This isn't my expected result.
    So, how can I lock the record in the form? Any suggestion? Please help and thank you all for advice.

    I use Oracle 10 g 10g 2 formula.

    Thank you.

    Kind regards.

    Looks like that record is already locked by another user. So, what do you expect the form in this case.

    BTW... Instead of locking the record "by hand", you can also use EXECUTE_QUERY (FOR_UPDATE)

  • How to initialize the recorder?

    Hello

    How initialize the recorder in jsp ?

    I tried:
    static Logger logger = Logger.getLogger ("XELLERATE");
    Logger.Warn ("example text");

    .. but it throws error:
    Recorder cannot be resolved to a type Logger...

    Is another way to do this?

    Kind regards
    N....

    Published by: m.m. December 2, 2009 03:54

    Add these lines:

    <%@ page import="com.thortech.util.logging.Logger" %>

    < %="">< br="">Logger logger = Logger.getLogger ("XELLERATE"); < br=""> logger.warn ("* text sample *"); < br=""> %>

Maybe you are looking for