Skip to content

Commit c192bb4

Browse files
committed
Added T4SQL.META_CREATE_PROPERTY_VIEW
1 parent 6c452e3 commit c192bb4

File tree

5 files changed

+87
-4
lines changed

5 files changed

+87
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
CREATE PROCEDURE T4SQL.META_CREATE_PROPERTY_VIEW
2+
(
3+
@inWorkitem_Table NVARCHAR(128),
4+
@inProperty_Table NVARCHAR(128)
5+
)
6+
AS
7+
SET NOCOUNT ON;
8+
9+
DECLARE @tSchema NVARCHAR(64), @tTab NVARCHAR(64), @tView NVARCHAR(128), @tDdlSql NVARCHAR(2048);
10+
11+
SET @tSchema = PARSENAME(@inProperty_Table, 2);
12+
SET @tTab = PARSENAME(@inProperty_Table, 1);
13+
14+
IF @tSchema IS NULL
15+
SET @tView = N'VW_' + @tTab
16+
ELSE
17+
SET @tView = @tSchema + N'.VW_' + @tTab;
18+
19+
IF OBJECT_ID(@tView) IS NOT NULL
20+
RETURN;
21+
22+
SET @tDdlSql = N'CREATE VIEW ' + @tView + N'
23+
AS
24+
SELECT
25+
P.WORKITEM_NAME,
26+
S.PROPERTY_ORDER,
27+
P.PROPERTY_NAME,
28+
P.STRING_VALUE,
29+
P.LINK_STATE,
30+
CAST(CASE
31+
WHEN ISNULL(P.STRING_VALUE, NCHAR(13)) = ISNULL(S.DEFAULT_VALUE, NCHAR(13)) AND
32+
ISNULL(P.LINK_STATE, NCHAR(13)) = ISNULL(S.LINK_STATE, NCHAR(13))
33+
THEN 0
34+
ELSE 1
35+
END AS BIT) AS CUSTOM,
36+
S.DEFAULT_VALUE,
37+
S.LINK_STATE AS DEFAULT_LINK_STATE,
38+
S.PROPERTY_DESCRIPTION,
39+
S.CLASS_NAME,
40+
I.BUILD_ORDER
41+
FROM
42+
' + @inProperty_Table + N' P
43+
INNER JOIN
44+
' + @inWorkitem_Table + N' I
45+
ON (P.WORKITEM_NAME = I.WORKITEM_NAME)
46+
INNER JOIN
47+
T4SQL.TEMPLATE_SPEC S
48+
ON (P.PROPERTY_NAME = S.PROPERTY_NAME AND I.TEMPLATE_NAME = S.CLASS_NAME)
49+
/*
50+
ORDER BY
51+
I.BUILD_ORDER,
52+
P.WORKITEM_NAME,
53+
S.PROPERTY_ORDER,
54+
S.PROPERTY_NAME
55+
*/
56+
;';
57+
58+
EXECUTE (@tDdlSql);
59+
60+
----------------------------------------------------------------------------------------------------
61+
--
62+
-- Copyright 2013 Abel Cheng
63+
-- This source code is subject to terms and conditions of the Apache License, Version 2.0.
64+
-- See http://www.apache.org/licenses/LICENSE-2.0.
65+
-- All other rights reserved.
66+
-- You must not remove this notice, or any other, from this software.
67+
--
68+
-- Original Author: Abel Cheng <[email protected]>
69+
-- Created Date: ‎‎August ‎30, ‎2013, 3:39:13 PM
70+
-- Primary Host: http://t4sql.codeplex.com
71+
-- Change Log:
72+
-- Author Date Comment
73+
--
74+
--
75+
--
76+
--
77+
-- (Keep code clean)
78+
--
79+
----------------------------------------------------------------------------------------------------

T4SQLTemplateLibrary/Databases/SqlServer/Schema Objects/Schemas/T4SQL/Programmability/Stored Procedures/T4SQL.META_CREATE_WORKSPACE.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ AS
7373
@inWorkspace_Description,
7474
@inAutonomous_Owner
7575
);
76-
76+
77+
EXEC T4SQL.META_CREATE_PROPERTY_VIEW @inWorkitem_Table, @inProperty_Table;
78+
7779
----------------------------------------------------------------------------------------------------
7880
--
7981
-- Copyright 2013 Abel Cheng

T4SQLTemplateLibrary/Databases/SqlServer/T4SQLDB.sqlproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
<Build Include="Schema Objects\Schemas\T4SQL\Tables\T4SQL.UTL_ORDINAL_NUMBER.sql" />
278278
<Build Include="Schema Objects\Schemas\T4SQL\Views\T4SQL.VW_ORDINAL_DATE.sql" />
279279
<Build Include="Schema Objects\Schemas\T4SQL\Views\T4SQL.VW_ORDINAL_NUMBER_EXPANSION.sql" />
280+
<Build Include="Schema Objects\Schemas\T4SQL\Programmability\Stored Procedures\T4SQL.META_CREATE_PROPERTY_VIEW.sql" />
280281
</ItemGroup>
281282
<ItemGroup>
282283
<None Include="Scripts\Post-Deployment\1-T4SQL.ENGINE_CONFIG.data.sql">

T4SQLTemplateLibrary/SqlBuilder/SqlBuilder.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
<WarningLevel>4</WarningLevel>
3939
</PropertyGroup>
4040
<ItemGroup>
41-
<Reference Include="DbParallel.DataAccess, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
42-
<HintPath>..\packages\DataBooster.Oracle.Managed.1.1.0.0\lib\net40-Client\DbParallel.DataAccess.dll</HintPath>
41+
<Reference Include="DbParallel.DataAccess, Version=1.1.0.1, Culture=neutral, processorArchitecture=MSIL">
42+
<SpecificVersion>False</SpecificVersion>
43+
<HintPath>..\packages\DataBooster.Oracle.Managed.1.1.0.1\lib\net40-Client\DbParallel.DataAccess.dll</HintPath>
4344
</Reference>
4445
<Reference Include="Oracle.ManagedDataAccess">
4546
<HintPath>..\packages\odp.net.managed.121.1.1\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="DataBooster.Oracle.Managed" version="1.1.0.0" targetFramework="net40-Client" />
3+
<package id="DataBooster.Oracle.Managed" version="1.1.0.1" targetFramework="net40-Client" />
44
<package id="odp.net.managed" version="121.1.1" targetFramework="net40-Client" />
55
</packages>

0 commit comments

Comments
 (0)