Given the following DDL:
CREATE TABLE FOODSALESTEST
("WEEKNBR" NUMBER,
"STOREID" NUMBER NOT NULL,
"GUESTS" NUMBER NOT NULL,
"TACOSALES" NUMBER NOT NULL,
"SOUPYSALES" NUMBER NOT NULL);
Insert into FoodSalesTest VALUES (1,74,302,3021.71,3021.71);
Insert into FoodSalesTest VALUES (1,83,231,2106.58,2106.58);
Insert into FoodSalesTest VALUES (1,101,251,2163.5,2163.5);
Insert into FoodSalesTest VALUES (1,113,298,2953.82,2953.82);
Insert into FoodSalesTest VALUES (2,74,131,1168.11,1168.11);
Insert into FoodSalesTest VALUES (2,83,156,1258.22,1258.22);
Insert into FoodSalesTest VALUES (2,101,164,1550.87,1550.87);
Insert into FoodSalesTest VALUES (2,113,129,1384.26,1384.26);
Insert into FoodSalesTest VALUES (3,74,144,1594.02,1594.02);
Insert into FoodSalesTest VALUES (3,83,196,1867.2,1867.2);
Insert into FoodSalesTest VALUES (3,101,196,2052.96,2052.96);
Insert into FoodSalesTest VALUES (3,113,142,1490.63,1490.63);
Insert into FoodSalesTest VALUES (7,74,192,2496.17,2496.17);
Insert into FoodSalesTest VALUES (7,83,178,1971.54,1971.54);
Insert into FoodSalesTest VALUES (7,101,294,3477.88,3477.88);
Insert into FoodSalesTest VALUES (7,103,336,3398.42,3398.42);
--===
CREATE OR REPLACE PROCEDURE GETWEEKLYFOODSALES
(inweeknbr number
, p_rcWeekly in out sys_refcursor
) is
BEGIN
OPEN p_rcWeekly FOR
-- This has been simplified and as is not very practical.
-- It is actually a huge select statement with 6 "WITH" clauses and 15 joins and many selection criteria parameters
Select * from FoodSalesTest where weeknbr = inWeekNbr;
END GetWeeklyFoodSales;
--===
CREATE OR REPLACE PROCEDURE GETALLFOODSALES(
NbrOfWeeks In number
, p_rcWeek1 Out sys_refcursor
, p_rcWeek2 out sys_refcursor
, p_rcWeek3 out sys_refcursor
, p_rcWeek7 out sys_refcursor
) is
begin
GetWeeklyFoodSales( 1 , p_rcWeek1);
GetWeeklyFoodSales( 2 , p_rcWeek2);
if NbrOfWeeks = 3 then
GetWeeklyFoodSales( 3 , p_rcWeek3);
end if;
GetWeeklyFoodSales( 7 , p_rcWeek7);
END GetAllFoodSales;
GetWeeklyfoodSales is actually a huge select statement with 6 "WITH" clauses and 15 joins and many selection criteria parameters. It is probably possible to combine all functionality in 1 stored procedure but I want to modularize.
1) How do I select all cursors into 1 single cursor in GetAllFoodSales?
2) Why Cant I do this? = why isn't the cursordata maintained since it is defined as IN OUT in GetWeeklyFoodSales?
GetWeeklyFoodSales( 1 , p_TheOnlyCursor);
GetWeeklyFoodSales( 2 , p_TheOnlyCursor);
if NbrOfWeeks = 3 then
GetWeeklyFoodSales( 3 , p_TheOnlyCursor);
end if;
GetWeeklyFoodSales( 7 , p_TheOnlyCursor);
WHERE invoked procedure has these parms:
inweeknbr IN number
, p_rcWeekly IN OUT sys_refcursor
3) I would also like to have 2 more output cursor in GetAllFoodSales. Descriptively:
1. p_SummedResultsByStoreID
2. p_SummedResultsByWeekNumber
These must be separate cursors in order for program to consume for report
Need help in Generating Combinations
Need help generating all possible combination of names in an arrayLets say i have the following array:$names = array("jack","john","Adam","Mike");Now my goal is
Run function every 5 mins ??
I have a function PostMessage()How can I run it every 5 mins ??
rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?
search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please helpCode: [Select]<table width="300" border="0" align="center" cellpadding="0"
how can i expire the submitted page using session.
hi,i'm new to php world.i'm using "post" method.when i submit it,data goes to database successfully.BUT when i click the back button of browser(IE) the previouspage will appear.how can i
how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste it .... not really wanting to use a TEXTAREA box .... any ideas ?
Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, whitepages.com, etc..) and collect the information on the people found there and throw it into a
quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...I often see an example like this:$a = $b . " " . $c; // concatenate strings with spaceI'm wondering if there is
str_replace help
Hey there,I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean up bad html to valid xhtml, I am using:Code: $pee = str_replace('&', '&amp;', $pee);It
Help with email validation please...
Hi, Please could you help. I have a register.php login page where users register, the details are then logged into a temporary database, the user receives an email to verify their email address and