hytos / ID2.Manager / DataBaseCreate / MarkupDataParse.sql @ 2ade1e61
이력 | 보기 | 이력해설 | 다운로드 (1.29 KB)
1 |
USE [ID2Manager] |
---|---|
2 |
GO |
3 |
|
4 |
/****** Object: UserDefinedFunction [dbo].[MarkupDataParse] Script Date: 2023-08-16 ���� 1:20:32 ******/
|
5 |
DROP FUNCTION [dbo].[MarkupDataParse] |
6 |
GO |
7 |
|
8 |
/****** Object: UserDefinedFunction [dbo].[MarkupDataParse] Script Date: 2023-08-16 ���� 1:20:32 ******/
|
9 |
SET ANSI_NULLS ON |
10 |
GO |
11 |
|
12 |
SET QUOTED_IDENTIFIER ON |
13 |
GO |
14 |
|
15 |
-- =============================================
|
16 |
-- Author: <Author,,Name>
|
17 |
-- Create date: <Create Date, ,>
|
18 |
-- Description: <Description, ,>
|
19 |
-- =============================================
|
20 |
CREATE FUNCTION [dbo].[MarkupDataParse] |
21 |
( |
22 |
-- Add the parameters for the function here
|
23 |
@MARKUP_DATA VARCHAR(MAX) |
24 |
) |
25 |
RETURNS VARCHAR(MAX) |
26 |
AS
|
27 |
BEGIN
|
28 |
-- Declare the return variable here
|
29 |
DECLARE @RESULT_VALUE VARCHAR(MAX) |
30 |
DECLARE @DECOMPRESS_DATA VARCHAR(MAX) |
31 |
|
32 |
SET @DECOMPRESS_DATA = CONVERT(varchar(max), CONVERT(xml, decompress(CAST(REPLACE(@MARKUP_DATA,'|DZ|','') as xml).value('xs:base64Binary(.)', 'varbinary(max)')))) |
33 |
|
34 |
IF JSON_VALUE(@DECOMPRESS_DATA, '$.Text') IS NOT NULL |
35 |
SET @RESULT_VALUE = JSON_VALUE(@DECOMPRESS_DATA, '$.Text') |
36 |
ELSE IF JSON_VALUE(@DECOMPRESS_DATA, '$.ArrowText') IS NOT NULL |
37 |
SET @RESULT_VALUE = JSON_VALUE(@DECOMPRESS_DATA, '$.ArrowText') |
38 |
ELSE
|
39 |
SET @RESULT_VALUE = NULL |
40 |
|
41 |
-- Return the result of the function
|
42 |
RETURN @RESULT_VALUE |
43 |
|
44 |
END
|
45 |
GO |
46 |
|
47 |
|