USE [DD_ECM]
GO

/****** Object:  View [dbo].[VWPMO_CONTROL_SCREEN]    Script Date: 30.03.2015 10:13:05 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


ALTER VIEW [dbo].[VWPMO_CONTROL_SCREEN] AS
SELECT TOP 100 PERCENT
	T.GUID			CONTROL_ID,
	T.NAME			CONTROL_NAME,
	T.REQUIRED		CONTROL_REQUIRED,
	T.FORMAT_TYPE	CONTROL_FORMAT_TYPE,
	T.DEFAULT_VALUE	CONTROL_DEF_VALUE,
	T.READ_ONLY		CONTROL_READ_ONLY,
	T.MULTILINE		CONTROL_MULTILINE,
	T.PARENT_CONTROL_ID	CONTROL_PARENT_ID,
	T.COL_NAME		CONTROL_COL_NAME,
	T.SHOW_COLUMN   CONTROL_SHOW_COLUMN,
	T.CONNECTION_ID_1	CONTROL_CONNID_1,
	T.SQL_COMMAND_1		CONTROL_SQLCOMMAND_1,
	T4.GUID			CTRLTYPE_ID,
	T4.TYPE_NAME	CTRLTYPE_NAME,
	T.FORM_ID,
	T3.NAME			FORM_NAME,
	T3.LEVEL		FORM_LEVEL,
	T1.SCREEN_ID	SCREEN_ID,
	T2.NAME			SCREEN_NAME,
	T1.GUID			CTRLSCR_ID,
	T1.CONTROL_TEXT	CTRLSCR_CAPTION,
	T1.X_LOC		CTRLSCR_X_LOC,
	T1.Y_LOC		CTRLSCR_Y_LOC,
	T1.HEIGHT		CTRLSCR_HEIGHT,
	T1.WIDTH		CTRLSCR_WIDTH,
	T1.FONT_FAMILY	CTRLSCR_FONT_FAMILY,
	T1.FONT_COLOR	CTRLSCR_FONT_COLOR,
	T1.FONT_SIZE	CTRLSCR_FONT_SIZE,
	T1.FONT_STYLE	CTRLSCR_FONT_STYLE,
	T1.TAB_INDEX	CTRLSCR_TAB_INDEX,
	T1.TAB_STOP		CTRLSCR_TAB_STOP,
	T1.BACK_COLOR   CTRLSCR_BACK_COLOR,
	T.MASTER_DATA_ID CTRLSCR_MASTER_DATA_ID
FROM
	TBPMO_CONTROL T,
	TBPMO_CONTROL_SCREEN T1,
	TBPMO_SCREEN T2,
	TBPMO_FORM T3,
	TBPMO_CONTROL_TYPE T4
WHERE
	T.FORM_ID = T3.GUID AND
	T.GUID = T1.CONTROL_ID AND
	T1.SCREEN_ID = T2.GUID AND
	T.CONTROL_TYPE_ID = T4.GUID
ORDER BY 
	T1.SCREEN_ID,
	T.FORM_ID,
	T1.TAB_STOP








GO


