You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ITSM/.svn/pristine/f8/f85abe630fea5bac7e58f86b0c5...

167 lines
5.4 KiB

USE [Vertragsverwaltung_20160404]
GO
/****** Object: UserDefinedFunction [dbo].[get_applobject] Script Date: 02.12.2016 09:08:53 ******/
DROP FUNCTION [dbo].[get_applobject]
GO
/****** Object: UserDefinedFunction [dbo].[get_applobject] Script Date: 02.12.2016 09:08:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[get_applobject]
(
-- Add the parameters for the function here
@input_guid varchar(255),
@input_type int
)
RETURNS varchar(1024)
AS
BEGIN
declare @resultat varchar(1024)
set @resultat=''
declare @appl varchar(255)
declare @crlf varchar(2)
SET @crlf = char(13) + char(10)
if @input_type=1 begin
declare xc cursor for
select applikation from applikationarchitekturobjectappl where guid=@input_guid
open xc
fetch next from xc into @appl
while @@fetch_status=0 begin
set @resultat=@resultat + '- '+@appl+@crlf
fetch next from xc into @appl
end
close xc
deallocate xc
RETURN @resultat
end
if @input_type=2 begin
declare xc cursor for
select datenbank from applikationarchitekturobjectdb where guid=@input_guid
open xc
fetch next from xc into @appl
while @@fetch_status=0 begin
set @resultat=@resultat + '- '+@appl+@crlf
fetch next from xc into @appl
end
close xc
deallocate xc
RETURN @resultat
end
if @input_type=3 begin
declare xc cursor for
select sst from applikationarchitekturobjectsst where guid=@input_guid
open xc
fetch next from xc into @appl
while @@fetch_status=0 begin
set @resultat=@resultat + '- '+@appl+@crlf
fetch next from xc into @appl
end
close xc
deallocate xc
RETURN @resultat
end
if @input_type=4 begin
declare xc cursor for
select applikation from applikationarchitekturobjectvirt where guid=@input_guid
open xc
fetch next from xc into @appl
while @@fetch_status=0 begin
set @resultat=@resultat + '- '+@appl+@crlf
fetch next from xc into @appl
end
close xc
deallocate xc
RETURN @resultat
end
RETURN @resultat
END
GO