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
quotes changing
hi allin my contentopening quotes " changes to “close quotes " changes to �what should i use.example :Code: sams’s “whip lashâ€
Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaWiki on my site and I'm trying to install some extensions. In order to install the Search
A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
Converting RGB values to HEX
Code: <?PHP$file_handle = fopen("colors/rgb.csv", "r");while (!feof($file_handle) ) {$line_of_text = fgetcsv($file_handle, 1024);print $line_of_text[2] . $line_of_text[3] .
storing results of a function - previous result overwritten with new result
I have created a function to validate input.function validate_dimension($value,$name) {global $errors;$errors = array();......validation actions here - this all works fine - if I get an error it is
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page will use code to pull information from a database and display it on the page in a formatted way.Code:
whats wrong with my code please help!!!
this is the errorWarning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line Code: <?php$srch = $_REQUEST["srch"];if (empty($srch)) {
Something like an INI editor or a DelimitedText-Editor
Hi all,Am very, very, very new to PHP and not sure if I should be posting this to a Javascript or PHP forum so I posed the question on both FORUM.Basically, I am looking for something like an INI
PHP, Arrays & A Lot Of Confusion
I've been doing basic PHP work on sites for a few years now, but I've never been tempted to learn how the ARRAY function worked, nor in what instances to use it. Now I've stumbled upon the jCarousel
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.I have roughly 30 files. I want to be able to edit every $_POST and $_GETCode: