How can implement running total in oracle forms

I want to implement a running total in oracle form
like
100 100
300 400
200 600
500 1100
200 1300
100 1400
PROCEDURE calculate_srno IS
current_rownum     integer:=:System.Cursor_Record;
starting_srno integer:=:rs_1;
last_rownum integer;
BEGIN
     last_record;
     last_rownum:=:system.cursor_record;
     go_record(1);
     FOR counter IN 1..last_rownum LOOP
          :sum_1:=:rs_1;
          :rs_1:=:sum_1+:rs_1;
     --     :offered_srno_to:=starting_srno;
          if last_rownum=:System.Cursor_Record then exit;
          end if;
     END LOOP;
END;
it is not working after want to insert between in the table

Why write code for this? Oracle Forms 10g has Calculated/Summary fields that will do this for you without the need of writing any PL/SQL.
Simply add a non-table item to the data block with the item you want to keep the running total for. Then change the following properties of the item:
Data Type: Number
Calculation Mode: Summary
Summary Function: Sum
Summarized Block: <Your Data Block>
Summarized Item: <Your Block Item>
Number of Items Displayed: 1 (if your item is in a Multi-Record (Tabular) layout else you don't need to change this property.
You will also need to change the following property of the block: Query All Records: Yes
If changing the Block's "Query All Records" property causes your form to be too slow because of the number of records in your block, then you could keep a running total manually by using a combination of the Post-Query and When-Validate-Item (WVI) triggers. If your block does not allow data entry, then you could do this with just the Post-Query trigger. For example:
BEGIN
  /* This code sample assumes you have added a non-table item */
  /* to your block called SUMMARY.  */
  :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
END;If your block allows data entry, then you would add the following to your existing WVI trigger.
BEGIN
  /* Perform your data entry validation logic first... */
  IF ....
  ELSE
    ...Validation is successful...
    :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
  END IF;
END;Hope this helps.
Craig...

Similar Messages

  • How can I code this in Oracle Forms?

    I have a master-detail form. In the detail block, I have several records. Here is my name table.
    ID Name_Type Name
    1 old Mike
    2 Current John
    3 old Peter
    4 old Andrew
    I would like to create a button trigger which shall perform the following:
    1) insert a record into database with a copy of current value. In the above case it will insert create a record for John as name_type = 'OLD'. So we have total of 5 records. Commit the transaction.
    2) Scroll through my detail records (5) and go to one specific record and erase the values from it. In the above case, it should find John's record with name_type = 'Current' and erase John from it.
    How can I accomplish this in Oracle forms using a button-pressed trigger?

    Hi,
    Simple, using current values you can create new id , 'old' and name so oracle will create record, now refresh block, next using next_record in loop you can find record,erase one and refresh block.
    Adinath Kamode

  • How can i run a reports from forms

    Oracle forms 9i
    Hai All
    I am using oracle forms 9i.
    From the forms i need to generate a reports how can i generate a reports from there
    Regards
    Srikkanth.M

    there are hundreds of examples in this forum. Do a search

  • How can I make OPAC in Oracle Forms Builder

    Hello everyone,
    I'm developing a Library Management System as my project in my Oracle subject.
    Can anyone tell me how to make OPAC module of Library management system in Oracle forms builder.
    I don't have any idea because this is my first encounter in this system.
    Thanks.
    I really appreciate all your help.
    God bless ^^

    Hi,
    Simple, using current values you can create new id , 'old' and name so oracle will create record, now refresh block, next using next_record in loop you can find record,erase one and refresh block.
    Adinath Kamode

  • How to Implement User Area in Oracle Forms 6i

    Hi,
    Could anyone please let me know how to implement Item Type *"User Area"* ?
    How to add User Area in layout Editor?,
    Thanks and Regards,
    Manasa

    Hi,
    Please post your question in the appropriate forum.
    Forms
    Forms
    Thanks,
    Hussein

  • How can I run another application from my Form

    Dear Gurus,
    Can anybody tell how can I run a non oracle application from my Forms..
    Can it be done thru DDE package..
    If yes then how..??
    Can it be done like Excel calling thru DDE package???
    Thanks in Advance..
    Regards
    Swati..

    Keep in mind that HOST will execute where the runtime is located. This means for Forms 6.x and older, if the application is running as client/server, HOST will correctly execute on the client. If your application (Forms 6.x and newer) is run via a web browser, HOST will execute on the server and not the client machine.
    Without knowing exactly which Forms version you are using and where you want the call to be executed it will be difficult to offer suggestions.

  • How can i run Report in Web (Oracle 9i)

    I working with Report Developer 9i,
    How Can i run my report to web ?

    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    Thanks
    Ratheesh

  • How can i run my form application on the other site?

    how can i run my form application(already compiled) on the other computer without developer/2000 environment?
    What should i do ?
    Thanks in advance!

    Well you have to install ORACLE developer runtime on your client side. then just copy your complied forms (fmx) files to your client machine and set it up to run.
    Hope this helps
    Faisal

  • How can we run and control live images form a camera plz help

    hi
    i want to now how can we run and control live images form a camera on to a aaplet.what technologyi used for this project . u can check the url http://www.jal.co.jp/en/live/ as a demo.plz can anyone guide me.how to start and which technologies to use,
    regards
    sheetal

    Hi,
    You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
    JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
    The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
    In the simplest case, one line of Java code can solve your problem.
    Good luck!

  • How can i run report from form?

    Hi.
    I build a report , the name is test , in this report i have 3 parametrs 'user_id' , 'Date_1' and 'Date_2'.
    how can i send those parametrs from form to report?
    i have 3 text item in form for get the parametrs.
    thanks alot

    You can run the report from within a program unit, using following :
    Run_Product(REPORTS, report_name, ASYNCHRONOUS, RUNTIME, FILESYSTEM, param_list, NULL);
    Here, report_name contains report file's name (test.rdf in your case) its type is Varchar2.
    param_list is of ParamList type, it contains the name-value pairs for parameters you want to pass to the report. You'll have to add parameters to this using addParameter() function. see the Help for addParameter().
    this will run the report using Report Background Engine.
    Regards,
    Muhammad Shakeel

  • How can I run the report for different input values at the same time?

    Reports version: Report Builder 6.0.8.13.1
    Oracle version: Oracle8i Enterprise Edition Release 8.1.7.0.0
    I want to run the same report for different input parameter values and spool each o/p to different file and ftp to a server. For this, as a first step, I am spooling different input values in to a file, reading those values through a loop and calling the report for that input values. Each report run/execution is taking 15 minutes. Total report execution is taking approximately 4 hours (assuming 16 different input values) to complete. So I have to wait 4 hours to see ALL outputs.
    I would like to run the report parallel for ALL the input values and I should be able to see the ALL outputs with in 15 or 16 minutes.
    In my shell script, I added & symbol at the end of the report call to start/run the job in the background. Due to this the control passed to the next step after the report call. At this place I have an ftp command to send the output file to a different server and it is giving error some thing like “o/p file is not available/created yet". This is due to the fact that report writer is NOT yet completely started/initiated or it is NOT completed the spooling.
    How can I run the report at the same time for all the input values and save the time?
    Thanks in advance.
    Kishore.

    Increase the number of server engines running right now it seems there is only one engine running ,increase it to 4 or 6
    and then atleast 4 or 6 reports will run simultaneously.
    For FTPing the output add to your sript to check whether it is locked and if not then only try to ftp .
    Also for more better functionality read the document (chapter 15 ) for 10g reports for its new fuinctionality.
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/toc.htm
    Thanks
    Subodh

  • How can i run the java bean sample program download from OTN

    hello to all
    i have a p[roblem. i have downloaded the sample progam from oracle web site which is a java code that connect with the oracle and shows a form. how can i run the from.
    can any body help me pleaSEEE
    thanks
    kamran ahmed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi Darryl.Burke
    So your telling, we cannot run our Java Program when system shutdowns...In my application, when user has schedule for next days and he shutdown his PC. On the next day when System Started i should able to get back my schedule on the Specified time(I'm TimerTask class in Java)... How can i achieve this using Java? can u tell me clearly..

  • How Can I Run A SQLJ Normal Project In SAP NWDS

    I have a question about SQLJ in SAP NWDS.
    1.I created a java dictionary project,and then create the table , then depoly it.it's ok.
    2.I created a java normal project including the above java dictionary project.
    3.I used the SQLJ tech in the java normal project,exporting the opensqllib.jar,sqljapi.jar,sqljc.jar,sqljimpl.jar.
    4.I coded the normal project,and export the project .jar,everything is ok.
    <b>5.But when i runed the project in NWDS,the error appeared:java.lang.NoClassDefFoundError: com/sap/sql/log/OpenSQLException
         at com.ezkj.deom.sqlj.MainApp.main(MainApp.java:21)
    Exception in thread "main"</b>
    How Can I Run A SQLJ Normal Project In SAP NWDS?
    PLS Help me and don't let me alone!

    Tony,
    Why not try to import your SQLJ project in SAP NWDS. Add all the jars mentioned to the project path both for compile time as well as runtime. Now try running he project. Once you are able to bypass java.lang.NoClassDefFoundError, you will get other errors related to SQL statements. These Oracle SQL statements needs to be converted to OpenSQL format.
    Chill out!!!
    Sukanta Rudra
    Note: If helpful, plz donate some points.

  • How Can I Run a SQL Loader Job from Schedular

    How Can I Run a SQL Loader Job from Schedular , So that It Runs every Day.

    Depends on a couple of factors.
    If you are on a UNIX platform, you can create a shell script and schedule it with cron.
    If you are on a Windows platform, you can create a batch file and schedule it with the Windows scheduler.
    Or, if you are on Oracle 9i or 10g, you could use the external table feature instead of SQL*Loader. Then you could write a stored procedure to process the external table and schedule it using the Oracle scheduler (DBMS_JOB). This would probably be my preference.

  • How can I run a SQL script file...

    How can I run a SQL script file from a location on my computer without providing the whole path?
    Is there some way I can set a "Working folder" in SQL Plus??
    Thanks!
    Tom

    You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
    scripts.
    I would like to use another directory than the oracle/bin...
    How can I do this ??
    Hello,
    U can do this by this way:
    Save odm_script.sql file to the default Oracle
    directory i.e. Oracle-Home/bin and Run following command
    through SQL Plus.
    SQL>@Script_Name
    I hope this will resolve ur problem.
    Regards,
    Omer Saeed Khan.

Maybe you are looking for

  • Will no longer hold charge. Keyboard will not print in text window. Will not place a phone call.

    I received my DX2 in November of 2011, It worked fine until January of 2013. With the occasional lock up texting. However since January it will not place a call regularly. It gets as far as the green phone to complete call and will not go further. Tr

  • Safari Spinning Out of Control - Why Doesn't This Get Better?!!

    For a very extended period, Safari has been spinnin out of control memory-wise - no other OS I use does this, not does any other browser I use on OSX.  This goes on and on and on and on, with no real remidiation coming from Apple.  It is maddening an

  • IBM COBOL-DB2 with ATMI calls program - buildserver

    Hi.. Am using IBM COBOL for AIX 5.3.. I have installed Oracle Tuxedo 10gr3 and DB2 V9.5 on AIX.. I have written a sample client and server COBOL DB2 with ATMI calls program.. I have configured Tuxedo for DB2 according to the document given by IBM htt

  • MCL and PreLoader Debacle

    Hello...thanks in advance, especially those (kglad) who have been responding to previous posts of mine regarding this same problem. I'm going out of my mind though with this...basically I have an extremeley tempermental flash movie which plays differ

  • Will not enter bios setup

    Every time i hit the F1 key on my HP Pavilion 7965 Desktop I get the HP screen and at the bottom of it, the message "Entering SETUP".  However that is as far as it goes.  It just seems to freeze and does not enter setup.  Does any one knows why and h