Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PL SQL

RE: PL SQL

From: David Barbour <DBarbour_at_connectsouth.com>
Date: Thu, 7 Sep 2000 13:49:34 -0500
Message-Id: <10612.116438@fatcity.com>


A quickie in PL/SQL -

Cursor c_compare is

	Select invoice_number, price
	from Invoices;
	
	v_invoice		Invoices.invoice_number%type;
	v_price		Invoices.price%type;
	v_invoice_old	Invoices.invoice_number%type;
	v_price_old		Invoices.price%type;
	counter		number;

	counter:=0;

Open c_compare;
	LOOP
		Fetch c_compare into v_invoice, v_price;
	EXIT when c_compare%NOTFOUND;
		
		v_invoice_old=v_invoice;
		v_price_old=v_price;

	IF counter > 0 then

	END IF;

	counter:=counter + 1;
	
	END LOOP;

END;                  David A. Barbour
Oracle DBA - ConnectSouth
512-681-9438
dbarbour_at_connectsouth.com

-----Original Message-----
From: Navtej B [mailto:navtej_b_at_yahoo.com] Sent: Thursday, September 07, 2000 1:05 PM To: Multiple recipients of list ORACLE-L Subject: PL SQL

Hi

Can somebody help with small code.

I am having a table say invoice where there 20 plus records exist for each invoiceID and suppose InvoiceID=100 and what I need is to compare first InvoiceID record column with second InvoiceId record column and then Second record with Third and then third with fourth until all the record for InvoiceID are compared

Please Help me as I need to finish this task today I am using Oracle 8.1.6 on Sun Platform and so guide that what should be the better solution whether PL/SQL table or 8i Global Temporary table or Arrays etc and if it is supplimented with small code help then it is very much appreicated

Thanking you in Advance



Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
-- 
Author: Navtej B
  INET: navtej_b_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Thu Sep 07 2000 - 13:49:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US