2803994 Enable explicit setting of tab parent link column

https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2803994&group_id=176962
This commit is contained in:
phib 2009-06-11 06:10:16 +00:00
parent 0289e55d97
commit ecf839802b
8 changed files with 203 additions and 10 deletions

View File

@ -115,6 +115,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
private String m_keyColumnName = "";
private String m_linkColumnName = "";
private String m_parentColumnName = "";
private String m_extendedWhere;
/** Attachments */
private HashMap<Integer,Integer> m_Attachments = null;
@ -597,6 +599,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
else
{
String value = Env.getContext(m_vo.ctx, m_vo.WindowNo, lc, true);
// explicit parent link defined
if ( m_parentColumnName.length() > 0 )
value = Env.getContext(m_vo.ctx, m_vo.WindowNo, m_parentColumnName, true);
// Same link value?
if (refresh)
refresh = m_linkValue.equals(value);
@ -1152,6 +1158,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
*/
public void setLinkColumnName (String linkColumnName)
{
// set parent column name
String sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?";
m_parentColumnName = DB.getSQLValueString(null, sql, m_vo.Parent_Column_ID );
if ( m_parentColumnName == null )
m_parentColumnName = "";
if (linkColumnName != null)
m_linkColumnName = linkColumnName;
else

View File

@ -180,7 +180,8 @@ public class GridTabVO implements Evaluatee, Serializable
vo.TableName = rs.getString("TableName");
if (rs.getString("IsView").equals("Y"))
vo.IsView = true;
vo.AD_Column_ID = rs.getInt("AD_Column_ID"); // Primary Parent Column
vo.AD_Column_ID = rs.getInt("AD_Column_ID"); // Primary Link Column
vo.Parent_Column_ID = rs.getInt("Parent_Column_ID"); // Parent tab link column
if (rs.getString("IsSecurityEnabled").equals("Y"))
vo.IsSecurityEnabled = true;
@ -384,8 +385,10 @@ public class GridTabVO implements Evaluatee, Serializable
public boolean HasTree = false;
/** Table */
public int AD_Table_ID;
/** Primary Parent Column */
/** Primary Link Column */
public int AD_Column_ID = 0;
/** Parent Tab Link Column */
public int Parent_Column_ID = 0;
/** Table Name */
public String TableName;
/** Table is View */
@ -493,6 +496,7 @@ public class GridTabVO implements Evaluatee, Serializable
clone.HasTree = HasTree;
clone.AD_Table_ID = AD_Table_ID;
clone.AD_Column_ID = AD_Column_ID;
clone.Parent_Column_ID = Parent_Column_ID;
clone.TableName = TableName;
clone.IsView = IsView;
clone.AccessLevel = AccessLevel;

View File

@ -5,7 +5,7 @@ CREATE OR REPLACE VIEW AD_TAB_V
ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB, ISREADONLY,
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, INCLUDED_TAB_ID)
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, INCLUDED_TAB_ID, PARENT_COLUMN_ID)
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -14,7 +14,7 @@ SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'

View File

@ -6,7 +6,7 @@ CREATE OR REPLACE VIEW AD_TAB_VT
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID)
INCLUDED_TAB_ID, PARENT_COLUMN_ID)
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -15,7 +15,7 @@ SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, tr
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)

View File

@ -5,7 +5,8 @@ CREATE OR REPLACE VIEW AD_TAB_V
ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB, ISREADONLY,
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, INCLUDED_TAB_ID)
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID)
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -14,7 +15,7 @@ SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'

View File

@ -6,7 +6,7 @@ CREATE OR REPLACE VIEW AD_TAB_VT
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID)
INCLUDED_TAB_ID, PARENT_COLUMN_ID)
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -15,7 +15,7 @@ SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, tr
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)

View File

@ -0,0 +1,84 @@
-- 11/06/2009 14:51:45
-- Add Parent_Column_ID to tab
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53874,0,'Parent_Column_ID',TO_DATE('2009-06-11 14:51:43','YYYY-MM-DD HH24:MI:SS'),100,'The link column on the parent tab.','D','Y','Parent Column','Parent Column',TO_DATE('2009-06-11 14:51:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11/06/2009 14:51:45
-- Add Parent_Column_ID to tab
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53874 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- 11/06/2009 14:53:27
-- Add Parent_Column_ID to tab
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52056,'/* attempt to get the columns in the parent tab table */
AD_Column.AD_Table_ID IN (SELECT t.AD_Table_ID FROM AD_Tab t
WHERE t.AD_Window_ID = @AD_Window_ID@
AND t.TabLevel = @TabLevel@-1
AND t.SeqNo < @SeqNo@
AND NOT EXISTS (SELECT 1 FROM AD_Tab t2
where t2.AD_Window_ID=t.AD_Window_ID
AND t2.TabLevel = t.TabLevel
AND t2.SeqNo < @SeqNo@
AND t2.SeqNo > t.SeqNo) )',TO_DATE('2009-06-11 14:53:27','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','AD_Column (Parent tab link column)','S',TO_DATE('2009-06-11 14:53:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11/06/2009 14:55:41
-- Add Parent_Column_ID to tab
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57842,53874,0,18,251,106,52056,'Parent_Column_ID',TO_DATE('2009-06-11 14:55:39','YYYY-MM-DD HH24:MI:SS'),100,'The link column on the parent tab.','D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Parent Column',0,TO_DATE('2009-06-11 14:55:39','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 11/06/2009 14:55:41
-- Add Parent_Column_ID to tab
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57842 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- 11/06/2009 14:55:45
-- Add Parent_Column_ID to tab
ALTER TABLE AD_Tab ADD Parent_Column_ID NUMBER(10) DEFAULT NULL
;
-- 11/06/2009 14:57:07
-- Add Parent_Column_ID to tab
UPDATE AD_Field SET IsSameLine='N',Updated=TO_DATE('2009-06-11 14:57:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2575
;
-- 11/06/2009 14:58:54
-- Add Parent_Column_ID to tab
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57842,57266,0,106,TO_DATE('2009-06-11 14:58:53','YYYY-MM-DD HH24:MI:SS'),100,'The link column on the parent tab.',14,'D','Y','Y','Y','N','N','N','N','Y','Parent Column',205,0,TO_DATE('2009-06-11 14:58:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11/06/2009 14:58:54
-- Add Parent_Column_ID to tab
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57266 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
CREATE OR REPLACE VIEW AD_Tab_V
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, 'N' AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
CREATE OR REPLACE VIEW AD_Tab_VT
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, 'N' AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';

View File

@ -0,0 +1,90 @@
-- 11/06/2009 14:51:45
-- Add Parent_Column_ID to tab
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53874,0,'Parent_Column_ID',TO_TIMESTAMP('2009-06-11 14:51:43','YYYY-MM-DD HH24:MI:SS'),100,'The link column on the parent tab.','D','Y','Parent Column','Parent Column',TO_TIMESTAMP('2009-06-11 14:51:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11/06/2009 14:51:45
-- Add Parent_Column_ID to tab
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53874 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- 11/06/2009 14:53:27
-- Add Parent_Column_ID to tab
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52056,'/* attempt to get the columns in the parent tab table */
AD_Column.AD_Table_ID IN (SELECT t.AD_Table_ID FROM AD_Tab t
WHERE t.AD_Window_ID = @AD_Window_ID@
AND t.TabLevel = @TabLevel@-1
AND t.SeqNo < @SeqNo@
AND NOT EXISTS (SELECT 1 FROM AD_Tab t2
where t2.AD_Window_ID=t.AD_Window_ID
AND t2.TabLevel = t.TabLevel
AND t2.SeqNo < @SeqNo@
AND t2.SeqNo > t.SeqNo) )',TO_TIMESTAMP('2009-06-11 14:53:27','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','AD_Column (Parent tab link column)','S',TO_TIMESTAMP('2009-06-11 14:53:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11/06/2009 14:55:41
-- Add Parent_Column_ID to tab
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57842,53874,0,18,251,106,52056,'Parent_Column_ID',TO_TIMESTAMP('2009-06-11 14:55:39','YYYY-MM-DD HH24:MI:SS'),100,'The link column on the parent tab.','D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Parent Column',0,TO_TIMESTAMP('2009-06-11 14:55:39','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 11/06/2009 14:55:41
-- Add Parent_Column_ID to tab
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57842 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- 11/06/2009 14:55:45
-- Add Parent_Column_ID to tab
ALTER TABLE AD_Tab ADD COLUMN Parent_Column_ID NUMERIC(10) DEFAULT NULL
;
-- 11/06/2009 14:57:07
-- Add Parent_Column_ID to tab
UPDATE AD_Field SET IsSameLine='N',Updated=TO_TIMESTAMP('2009-06-11 14:57:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2575
;
-- 11/06/2009 14:58:54
-- Add Parent_Column_ID to tab
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57842,57266,0,106,TO_TIMESTAMP('2009-06-11 14:58:53','YYYY-MM-DD HH24:MI:SS'),100,'The link column on the parent tab.',14,'D','Y','Y','Y','N','N','N','N','Y','Parent Column',205,0,TO_TIMESTAMP('2009-06-11 14:58:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11/06/2009 14:58:54
-- Add Parent_Column_ID to tab
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57266 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
DROP VIEW AD_TAB_V;
CREATE OR REPLACE VIEW AD_TAB_V
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
DROP VIEW AD_TAB_VT;
CREATE OR REPLACE VIEW AD_TAB_VT
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';