Oh experts,
I am finally on my way with Oracle. I've tossed everything I know about SQL Server and strictly focusing on Oracle. So I need help with the following. I have created a package with a procedure and I need to know how to find all data for the prior week starting from Sunday to Saturday. So today is Thursday April 20th 2006. I would need to capture all data From Sun Apr 9, 2006 - Sat Apr 15th 2006. I think you get the idea. I have the following Stored procedure in place. However, it becomes more complicated because the date field stored is an epoc date(1025273900). Damn Remedy. I know I have to do some conversion before I can capture last week's data but my conversion doesn't account for daylights savings time.
Lastly, what if I wanted to add a parameter called NumberofWeeks and let the user decide how many weeks back they want to go to collect the data. I.e. 2 weeks would mean get all data from Sun April 2, 2006 - Sat April 15th 2006. Your help is greatly appreciated. Sorry for all the questions.
CREATE OR REPLACE PACKAGE GroupsPackage
AS
TYPE CURSOR_TYPE IS REF CURSOR;
PROCEDURE Test(results_cursor IN OUT CURSOR_TYPE);
END;
/
CREATE OR REPLACE
PACKAGE BODY GroupsPackage
AS
PROCEDURE Test(results_cursor IN OUT CURSOR_TYPE)
IS
BEGIN
OPEN results_cursor FOR
SELECT Entry_id, create_date, submitter
FROM Shr_people
WHERE Create_Date Between ?
ORDER BY Entry_Id;
END;
END;
/
I am finally on my way with Oracle. I've tossed everything I know about SQL Server and strictly focusing on Oracle. So I need help with the following. I have created a package with a procedure and I need to know how to find all data for the prior week starting from Sunday to Saturday. So today is Thursday April 20th 2006. I would need to capture all data From Sun Apr 9, 2006 - Sat Apr 15th 2006. I think you get the idea. I have the following Stored procedure in place. However, it becomes more complicated because the date field stored is an epoc date(1025273900). Damn Remedy. I know I have to do some conversion before I can capture last week's data but my conversion doesn't account for daylights savings time.
Lastly, what if I wanted to add a parameter called NumberofWeeks and let the user decide how many weeks back they want to go to collect the data. I.e. 2 weeks would mean get all data from Sun April 2, 2006 - Sat April 15th 2006. Your help is greatly appreciated. Sorry for all the questions.
CREATE OR REPLACE PACKAGE GroupsPackage
AS
TYPE CURSOR_TYPE IS REF CURSOR;
PROCEDURE Test(results_cursor IN OUT CURSOR_TYPE);
END;
/
CREATE OR REPLACE
PACKAGE BODY GroupsPackage
AS
PROCEDURE Test(results_cursor IN OUT CURSOR_TYPE)
IS
BEGIN
OPEN results_cursor FOR
SELECT Entry_id, create_date, submitter
FROM Shr_people
WHERE Create_Date Between ?
ORDER BY Entry_Id;
END;
END;
/