Hello All,
I hope that some one here can help. I should note that I have very limited experience in SQL. We are upgrading from a Redbrick (IBM) warehouse to a SQL server version. In an effort to avoid rewriting 3600 reports I am trying to create a user defined function in SQL that looks like a Redbrick function. Rebrick uses the function SUBSTR() where sql uses SUBSTRING(). I simply want to define a function in sql that uses SUBTRING when is sees SUBSTR.
On a separate note Redbrick also uses CURRENT_DATE (reserved in SQL). I want to get the system to see getdate instead. This is what I came up with, but it does not appear to work:
ALTER FUNCTION [dbo].[CURRENT_DATE]
(
)RETURNS
DATETIMEAS
BEGIN
-- Declare the return variable here --DECLARE GETDATE DATETIME -- Add the T-SQL statements to compute the return value here --SELECT GETDATE() -- Return the result of the function RETURN GETDATE()END
Any help would be appreciated.
Thanks,
Rog