1961 |
|
Buff: PRecordData; |
1962 |
|
begin |
1963 |
|
Buff := PRecordData(GetActiveBuf); |
1964 |
< |
result := (FQModify.SQL.Text <> '') or |
1965 |
< |
(Assigned(FUpdateObject) and (FUpdateObject.GetSQL(ukModify).Text <> '')) or |
1964 |
> |
result := (Trim(FQModify.SQL.Text) <> '') or |
1965 |
> |
(Assigned(FUpdateObject) and (Trim(FUpdateObject.GetSQL(ukModify).Text) <> '')) or |
1966 |
|
((Buff <> nil) and (Buff^.rdCachedUpdateStatus = cusInserted) and |
1967 |
|
(FCachedUpdates)); |
1968 |
|
end; |
1969 |
|
|
1970 |
|
function TIBCustomDataSet.CanInsert: Boolean; |
1971 |
|
begin |
1972 |
< |
result := (FQInsert.SQL.Text <> '') or |
1973 |
< |
(Assigned(FUpdateObject) and (FUpdateObject.GetSQL(ukInsert).Text <> '')); |
1972 |
> |
result := (Trim(FQInsert.SQL.Text) <> '') or |
1973 |
> |
(Assigned(FUpdateObject) and (Trim(FUpdateObject.GetSQL(ukInsert).Text) <> '')); |
1974 |
|
end; |
1975 |
|
|
1976 |
|
function TIBCustomDataSet.CanDelete: Boolean; |
1977 |
|
begin |
1978 |
< |
if (FQDelete.SQL.Text <> '') or |
1979 |
< |
(Assigned(FUpdateObject) and (FUpdateObject.GetSQL(ukDelete).Text <> '')) then |
1978 |
> |
if (Trim(FQDelete.SQL.Text) <> '') or |
1979 |
> |
(Assigned(FUpdateObject) and (Trim(FUpdateObject.GetSQL(ukDelete).Text) <> '')) then |
1980 |
|
result := True |
1981 |
|
else |
1982 |
|
result := False; |
1984 |
|
|
1985 |
|
function TIBCustomDataSet.CanRefresh: Boolean; |
1986 |
|
begin |
1987 |
< |
result := (FQRefresh.SQL.Text <> '') or |
1988 |
< |
(Assigned(FUpdateObject) and (FUpdateObject.RefreshSQL.Text <> '')); |
1987 |
> |
result := (Trim(FQRefresh.SQL.Text) <> '') or |
1988 |
> |
(Assigned(FUpdateObject) and (Trim(FUpdateObject.RefreshSQL.Text) <> '')); |
1989 |
|
end; |
1990 |
|
|
1991 |
|
procedure TIBCustomDataSet.CheckEditState; |
2637 |
|
begin |
2638 |
|
if Buff <> nil then |
2639 |
|
begin |
2640 |
< |
if (Assigned(FUpdateObject) and (FUpdateObject.RefreshSQL.Text <> '')) then |
2640 |
> |
if (Assigned(FUpdateObject) and (Trim(FUpdateObject.RefreshSQL.Text) <> '')) then |
2641 |
|
begin |
2642 |
|
Qry := TIBSQL.Create(self); |
2643 |
|
Qry.Database := Database; |
3948 |
|
procedure TIBCustomDataSet.FieldDefsFromQuery(SourceQuery: TIBSQL); |
3949 |
|
const |
3950 |
|
DefaultSQL = 'Select F.RDB$COMPUTED_BLR, ' + {do not localize} |
3951 |
< |
'F.RDB$DEFAULT_VALUE, Trim(R.RDB$FIELD_NAME) as RDB$FIELD_NAME ' + {do not localize} |
3951 |
> |
'F.RDB$DEFAULT_VALUE, R.RDB$FIELD_NAME ' + {do not localize} |
3952 |
|
'from RDB$RELATION_FIELDS R, RDB$FIELDS F ' + {do not localize} |
3953 |
|
'where R.RDB$RELATION_NAME = :RELATION ' + {do not localize} |
3954 |
|
'and R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME '+ {do not localize} |
3956 |
|
' (not F.RDB$DEFAULT_VALUE is NULL)) '; {do not localize} |
3957 |
|
|
3958 |
|
DefaultSQLODS12 = 'Select F.RDB$COMPUTED_BLR, ' + {do not localize} |
3959 |
< |
'F.RDB$DEFAULT_VALUE, Trim(R.RDB$FIELD_NAME) as RDB$FIELD_NAME, R.RDB$IDENTITY_TYPE ' + {do not localize} |
3959 |
> |
'F.RDB$DEFAULT_VALUE, R.RDB$FIELD_NAME, R.RDB$IDENTITY_TYPE ' + {do not localize} |
3960 |
|
'from RDB$RELATION_FIELDS R, RDB$FIELDS F ' + {do not localize} |
3961 |
|
'where R.RDB$RELATION_NAME = :RELATION ' + {do not localize} |
3962 |
|
'and R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME '+ {do not localize} |
4000 |
|
while not Query.Eof do |
4001 |
|
begin |
4002 |
|
FField := TFieldNode.Create; |
4003 |
< |
FField.FieldName := Query.Fields[2].AsString; |
4003 |
> |
FField.FieldName := TrimRight(Query.Fields[2].AsString); |
4004 |
|
FField.DEFAULT_VALUE := not Query.Fields[1].IsNull; |
4005 |
|
FField.COMPUTED_BLR := not Query.Fields[0].IsNull; |
4006 |
|
FField.IDENTITY_COLUMN := (Query.FieldCount > 3) and not Query.Fields[3].IsNull; |