Home » Developer & Programmer » Forms » Clear Cursor Block
Clear Cursor Block [message #148714] Sat, 26 November 2005 20:45 Go to next message
sam007
Messages: 3
Registered: November 2005
Location: INDIA
Junior Member
Dear All,

I have made one block which is a control block and multi record too. I am fetching the record in this block with cursor. I have write the cursor like this :

DECLARE
  CURSOR c1 IS 
    SELECT sr_no,
           voucher_date,
           net_hkd,
           net_usd
    FROM   purchase_master
    WHERE  supplier_id = :payment_detail.ac_code
           AND company_id = :global.company_id;
   CURSOR c2 IS 
     SELECT sr_no,
            voucher_date,
            net_hkd,
            net_usd
     FROM   sales_master
     WHERE  customer_id = :payment_detail.ac_code
            AND company_id = :global.company_id;
BEGIN
  Go_block('INVOICE_DETAIL');
  
  Show_view('INVOICE_DETAIL');
  
  IF :PAYMENT_DETAIL.TYPE = 'PURCHASE' THEN
    OPEN c1;
    
    first_record;
    
    LOOP
      FETCH c1 INTO :INVOICE_DETAIL.invoice_no,
      :INVOICE_DETAIL.invoice_date,
      :INVOICE_DETAIL.amt_hkd,
      :INVOICE_DETAIL.amt_usd;
      
      EXIT WHEN c1%NOTFOUND;
      
      next_record;
    END LOOP;
    
    CLOSE c1;
  ELSIF :PAYMENT_DETAIL.TYPE = 'SALES' THEN
    OPEN c2;
    
    first_record;
    
    LOOP
      FETCH c2 INTO :INVOICE_DETAIL.invoice_no,
      :INVOICE_DETAIL.invoice_date,
      :INVOICE_DETAIL.amt_hkd,
      :INVOICE_DETAIL.amt_usd;
      
      EXIT WHEN c2%NOTFOUND;
      
      next_record;
    END LOOP;
    
    CLOSE c2;
  END IF;
END;

The problem is when i go to next record then also same record is shown by the this. I want to display the record as per query written in the cursor.

Pls help me in this it is urgent.

Sam

Mod-upd: Format code and add tags.

[Updated on: Tue, 06 December 2005 01:12] by Moderator

Report message to a moderator

Re: Clear Cursor Block [message #150031 is a reply to message #148714] Tue, 06 December 2005 01:13 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Did you solve your problem?

David
Previous Topic: MASTER DETAILED FORM
Next Topic: Please Help
Goto Forum:
  


Current Time: Fri Sep 20 03:59:09 CDT 2024