Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 31st, 2004, 07:40 PM
clemartin clemartin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 clemartin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
can someone please help me write a procedure

the procedure needs a fromal parameter shopper id and to sum the total column from THE BASKET TABLE.
THEN develope a select statment using the bbshoper table to produce a list of each shopper in the database ans his respective total

Reply With Quote
  #2  
Old November 19th, 2004, 04:22 PM
beunique beunique is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 50 beunique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
try some-in like:

CREATE OR REPLACE FUNCTION get_total_spent(p_shopper_id NUMBER)
RETURN NUMBER IS

total_spent NUMBER;

BEGIN

SELECT SUM(total_cost)
INTO total_spent
FROM basket
WHERE shopper_id = p_shopper_id;

RETURN total_spent;

WHEN NO_DATA_FOUND THEN
RETURN 0;

END;
/

SELECT shopper_id, get_total_spent(shopper_id) from bbshopper;

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > can someone please help me write a procedure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT