Menu

#101 InitCommandCriterias not respecting Connector.IdDataType

open
nobody
5
2012-11-03
2006-06-09
No

in TInstantRelationalTranslator inner procedure
InitCommandCriterias does not respect Connector.
IdDataType
it creates the condition as: ClassReferenceId <> ''
this ofcourse fails for all number types, because ''
cannot be converted to a number
I made a quick fix for myself (it might not work ok for
other types than Integer)

procedure InitCommandCriterias;
begin
if not Command.ClassRef.Any then
AddCriteria(Format('%s = %s',
[Qualify(ClassTablePath, InstantClassFieldName
),
QuoteString(Command.ClassRef.ObjectClassName)]

));
if Command.Specifier.IsPath then
begin
if Connector.IdDataType in [dtString, dtMemo,
dtBlob]
then
AddCriteria(Format('%s <> %s%s',
[QualifyPath(ConcatPath(Command.Specifier.
Text, InstantIdFieldName)),
Quote, Quote]
))
else
AddCriteria(Format('%s <> 0',
[QualifyPath(ConcatPath(Command.Specifier.Text,
InstantIdFieldName))]
));
end;

Discussion


Log in to post a comment.