Home » SQL & PL/SQL » SQL & PL/SQL » a complex query returning data in a refcursor.... (Oracle 10g release 2)
a complex query returning data in a refcursor.... [message #441343] Sat, 30 January 2010 23:46 Go to next message
abhi_shakya
Messages: 50
Registered: September 2009
Location: Nepal
Member
Table 1: Dealersdemand
DEMANDNO NOT NULL VARCHAR2(50)
DEMANDDATE DATE
DEMANDYEAR VARCHAR2(25)
DEMANDMONTH VARCHAR2(25)
DEMANDDAY VARCHAR2(25)
DEMANDFISCALYEAR VARCHAR2(25)
OFFICECODE VARCHAR2(50)
DEALERSCODE VARCHAR2(50)
CUSTOMERNAME VARCHAR2(400)
STATUS VARCHAR2(50)

Table 2: Demandproductsdetails
ID NOT NULL VARCHAR2(25)
DEMANDNO VARCHAR2(50)
PRODUCTCODE VARCHAR2(50)
QUANTITYDEMANDED VARCHAR2(50)
QUANTITYAPPROVED VARCHAR2(50)
QUANTITYAPPROVEDBY VARCHAR2(250)

Table 3: Dealersdetails
DEALERSCODE NOT NULL VARCHAR2(20)
DEALERSNAME VARCHAR2(50)
OWNERSNAME VARCHAR2(100)
REGCERTIFICATENO VARCHAR2(50)

I have these 3 tables.
In the 1st table the demand can be made either by dealer or customer.there r separate columns for dealerscode n customername.
now i want to display as follows:

Dealers/Customer ProductName Quantitydemanded Quantityapproved
ABC Kso 100 50
ABC Dso 70 30

The report shows what products r demanded by an individual customer or dealer I need to display dealerscode or customer name in same grid column...but they r stored in diff columns..
Re: a complex query returning data in a refcursor.... [message #441345 is a reply to message #441343] Sat, 30 January 2010 23:49 Go to previous message
BlackSwan
Messages: 24912
Registered: January 2009
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
It would be helpful if you provided DDL for tables involved.
It would be helpful if you provided DML for test data.
It would be helpful if you provided expected/desired results & a detailed explanation how & why the test data gets transformed or organized.
Previous Topic: Calculation of percentage based on total
Next Topic: problem in max() function
Goto Forum:
  


Current Time: Fri Sep 30 09:00:12 CDT 2016

Total time taken to generate the page: 0.05255 seconds