Problem with Data Dictionary
Hi Gurus,
I've got some problems with DataDictionary I can't resolve.
I have query which automatically fills in rb_table and rb_field tables. This
query just extracts table names(views in my case) and field names from db
shema like this:
Delete DMS_ReportTable
Insert DMS_ReportTable
select Name, Substring(Name, 2, len(Name)-1)
from dbo.sysobjects
where OBJECTPROPERTY(id, N'IsView') = 1 and CharIndex(' ', name)=1
Go
Delete DMS_ReportField
Insert DMS_ReportField
SELECT C.Table_Name as TableName,
C.Column_Name as ColumnName,
CONVERT(Varchar(60) , COALESCE(p.value,C.Column_Name)) as FieldAlias,
CONVERT(Varchar(60), C.Data_Type), 'Y', 'Y', 'Y', 'Y',
'N'
FROM INFORMATION_SCHEMA.COLUMNS c
INNER JOIN sysobjects t on t.name = c.table_name and OBJECTPROPERTY(id,
N'IsView') = 1
LEFT join sysproperties p ON p.id = t.id and p.smallid = c.ordinal_position
and p.name = 'MS_Description'
WHERE CharIndex(' ', C.TABLE_NAME)=1
Go
If I go to query wizard, it displays list of the tables correctly. Then,
when I click next to populate list of the fields, it appears empty.
Therefore, If I choose 2 tables and join dialog appears then all fields are
in place.
I suspect I don't populate rb_field table correctly. Is there any special
condition for 'datatype' field ? I use MSSQL and my query just pulls MS data
types like char, varchar etc. Also, for selectable, sortable and other
char(1) fields, is there '1'/'0' or 'Y'/'N' ?
Unfortunatelly I can not populate those tables using DataDictionary builder
in design time as my Delphi crashes because some bugs with the latest MDAC
dlls.
Cheers,
Dmitry
I've got some problems with DataDictionary I can't resolve.
I have query which automatically fills in rb_table and rb_field tables. This
query just extracts table names(views in my case) and field names from db
shema like this:
Delete DMS_ReportTable
Insert DMS_ReportTable
select Name, Substring(Name, 2, len(Name)-1)
from dbo.sysobjects
where OBJECTPROPERTY(id, N'IsView') = 1 and CharIndex(' ', name)=1
Go
Delete DMS_ReportField
Insert DMS_ReportField
SELECT C.Table_Name as TableName,
C.Column_Name as ColumnName,
CONVERT(Varchar(60) , COALESCE(p.value,C.Column_Name)) as FieldAlias,
CONVERT(Varchar(60), C.Data_Type), 'Y', 'Y', 'Y', 'Y',
'N'
FROM INFORMATION_SCHEMA.COLUMNS c
INNER JOIN sysobjects t on t.name = c.table_name and OBJECTPROPERTY(id,
N'IsView') = 1
LEFT join sysproperties p ON p.id = t.id and p.smallid = c.ordinal_position
and p.name = 'MS_Description'
WHERE CharIndex(' ', C.TABLE_NAME)=1
Go
If I go to query wizard, it displays list of the tables correctly. Then,
when I click next to populate list of the fields, it appears empty.
Therefore, If I choose 2 tables and join dialog appears then all fields are
in place.
I suspect I don't populate rb_field table correctly. Is there any special
condition for 'datatype' field ? I use MSSQL and my query just pulls MS data
types like char, varchar etc. Also, for selectable, sortable and other
char(1) fields, is there '1'/'0' or 'Y'/'N' ?
Unfortunatelly I can not populate those tables using DataDictionary builder
in design time as my Delphi crashes because some bugs with the latest MDAC
dlls.
Cheers,
Dmitry
This discussion has been closed.
Comments
it's fixed. Just converted MS SQL data types to RB datatypes
Cheers,
Dmitry