Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug or Behaviour ?
Message
De
28/07/2003 09:36:59
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Bug or Behaviour ?
Divers
Thread ID:
00814082
Message ID:
00814082
Vues:
51
Hi,

I have found MSQL documentation good ( not optimal !).

Then, on UDF i can't use GETDATE() ( a big limit ),
but:
CREATE FUNCTION dbo.fn_Scalar(@today DATETIME)
 RETURNS BIT
AS
 BEGIN
  RETURN 1
 END

CREATE FUNCTION dbo.fn_Table1(@today DATETIME)
RETURNS TABLE
RETURN SELECT CONVERT(BIT,1) value

CREATE FUNCTION dbo.fn_Table2(@today DATETIME)
RETURNS @R_TABLE TABLE (value BIT)
BEGIN
	INSERT @R_TABLE SELECT 1
	RETURN
END

-- execute this commands

SELECT dbo.fn_Scalar(GETDATE())
-- ok
SELECT * FROM dbo.fn_Table1(GETDATE())
-- syntax error
SELECT * FROM dbo.fn_Table2(GETDATE())
-- syntax error
Syntax error is a TSQL parser bug ?

If No:
- why TSQL have this limit ? I have big need of it.
- it is documented ?

Fabio
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform