It's been about 5 years since I trained on Oracle and I haven't used it since (I've been using SQL Server). I'm trying to write a basic function that will take a date and make sure that it happens between 7AM and 5PM M-F excluding holidays. I know that I could do it in a SQL Server procedure, but I think that Oracle won't let me declare and set variables inside a function. Should I use a procedure instead?
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
Code:
CREATE OR REPLACE FUNCTION rbm_fGetToolTime(dtTime date, intRegionStart smallint, intRegionEnd smallint) RETURN date
AS
/*
this function takes a date and makes sure that it is put into
standard format for the tool
All dates returned will be within the business day of the given region
*/
[red]
DECLARE
intBusHrs smallInt;[/red]
BEGIN
RETURN SYSDATE();
END;
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook