![]() |
Datenbank: ms sql • Version: 2005 • Zugriff über: ..
Function
Hallo miteinander,
ich möchte gerne eine fkt. aufbauen .. jedoch wird mir ständig der fehler incorect syntax near the keyword 'end' angezeigt .. leider hab ich nicht alzu viel erfahrung .. in der hinsicht .. deswegen hoffe ich, dass mir da jemand helfen könnte. hier der quelltext.
SQL-Code:
DAnke für eure mithilfe !
USE [Schienenmontage_B8_Zelle1]
GO /****** Object: UserDefinedFunction [dbo].[fn_Parameter_changes_Monitoring_Parameter_Unit] Script Date: 07/27/2010 13:54:30 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[fn_Parameter_changes_Monitoring_Parameter_Unit] ( @Param AS INT ) RETURNS NVARCHAR(4000) AS BEGIN If NOT (@Param = '') DECLARE @VALUE AS NVARCHAR(5) SET @VALUE = (SELECT [Value] FROM Parameter_changes_Monitoring_Parameter_Settings WHERE ([Param] = 'Parameter ' + CAST(@Param AS NVARCHAR(5)) + ' Unit')) END END RETURN @VALUE |
AW: Function
Zeigt er auch welches
SQL-Code:
er nicht mag?
END
|
AW: Function
hej m.kinzler,
das letzte 'end' kritisiert er .. hab es auch schon weg gelassen .. aber keinen erfolg gehabt .. |
AW: Function
Ich kenn mich mit dem MSSQL nicht so aus, aber bei
SQL-Code:
scheint ein
If NOT (@Param = '')
SQL-Code:
zu fehlen
THEN
|
AW: Function
Zitat:
|
AW: Function
Zitat:
|
AW: Function
Kann es sein, dass Value zurückgegeben wird, obwohl er ggf. gar nicht deklariert ist?
|
AW: Function
SQL-Code:
IF @Param <> '' BEGIN
... END |
AW: Function
SQL-Code:
-- ================================================
-- Template generated from Template Explorer using: -- Create Scalar Function (New Menu).SQL -- -- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below. -- -- This block of comments will not be included in -- the definition of the function. -- ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date, ,> -- Description: <Description, ,> -- ============================================= CREATE FUNCTION [dbo].[fn_Parameter_changes_Monitoring_Parameter_Unit] ( -- Add the parameters for the function here @PARAM AS INT ) RETURNS NVARCHAR(5) AS BEGIN IF NOT (@Param = '') BEGIN DECLARE @VALUE AS NVARCHAR(5) SET @VALUE = (SELECT [Value] FROM Parameter_changes_Monitoring_Parameter_Settings WHERE ([Param] = 'Parameter ' + CAST(@Param AS NVARCHAR(5)) + ' Unit')) END RETURN @VALUE END GO |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:58 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz