I need to make a table (tabel B) using table A. THANKS!
My current table
MBR_SID MinD MaxD
A 1/1/2008 1/10/2008
I need a table like this
mbr day
A 1/1/2008
A 1/2/2008
A 1/3/2008
I have a start --
CREATE OR REPLACE PROCEDURE PNMI_DAY AS
-- Declare Local Variable
StartDate DATE;
EndDate DATE;
CurrentDate DATE;
AdDate DATE; ---this is the bumping date...
BEGIN
StartDate := '01-JAN-2007'; -- Format (MM/DD/YYYY)
EndDate := '31-DEC-2007';
CurrentDate := StartDate;
EXECUTE IMMEDIATE 'TRUNCATE TABLE PNMI_DAYS';
WHILE CurrentDate <= EndDate
LOOP
INSERT INTO PNMI_DAYS (MBR_SID, DAYS)
SELECT DISTINCT MBR_SID,
TO_CHAR(MIND,'M M/DD/YYYY')
FROM PNMI_MBR
WHERE MBR_SID = 31500
AND MIND <= CurrentDate
AND MAXD >= CurrentDate;
CurrentDate := CurrentDate+ 1;
END LOOP;
END Pnmi_Day ;
/
My current table
MBR_SID MinD MaxD
A 1/1/2008 1/10/2008
I need a table like this
mbr day
A 1/1/2008
A 1/2/2008
A 1/3/2008
I have a start --
CREATE OR REPLACE PROCEDURE PNMI_DAY AS
-- Declare Local Variable
StartDate DATE;
EndDate DATE;
CurrentDate DATE;
AdDate DATE; ---this is the bumping date...
BEGIN
StartDate := '01-JAN-2007'; -- Format (MM/DD/YYYY)
EndDate := '31-DEC-2007';
CurrentDate := StartDate;
EXECUTE IMMEDIATE 'TRUNCATE TABLE PNMI_DAYS';
WHILE CurrentDate <= EndDate
LOOP
INSERT INTO PNMI_DAYS (MBR_SID, DAYS)
SELECT DISTINCT MBR_SID,
TO_CHAR(MIND,'M M/DD/YYYY')
FROM PNMI_MBR
WHERE MBR_SID = 31500
AND MIND <= CurrentDate
AND MAXD >= CurrentDate;
CurrentDate := CurrentDate+ 1;
END LOOP;
END Pnmi_Day ;
/
Comment