Subject | RE: [IBO] DefaultNoTrimming behavior |
---|---|
Author | Paul Hope |
Post date | 2008-11-20T13:10:59Z |
if you changed name in the database from 'Paul' to 'Paul ' IBO will
retrive it as 'Paul'. It may have something to do with char fields but
havent tested it. I had a problem of using a single character string field,
one value of which was ' ', IBO returned '' and if specified as param sent
it as ''. I had to use .asRawString to prevent this since I was happy with
trimming in normal circumstances.
Regards
Paul
retrive it as 'Paul'. It may have something to do with char fields but
havent tested it. I had a problem of using a single character string field,
one value of which was ' ', IBO returned '' and if specified as param sent
it as ''. I had to use .asRawString to prevent this since I was happy with
trimming in normal circumstances.
Regards
Paul
>
> Not sure, and AFAIR, but FB (at least 1.5.x) does not like
> string-parameters to be longer then the actual declared fieldsize.
>
> eg:...
> field Name : varchar(5)
> ....
> Name = :aName
> .....
> ParamByName('aName').asString:='Fabiano'
> would cause an error.
>
> Maybe (again, not sure) IBO autotrims the size of the passed
> parameter with this setting?
>
> regards,
> John
>
>
> personalsoft_fabiano wrote:
> > Hi, today i had to enable the 'DefaultNoTrimming' property of my
> > connection to workaround a problem, and i would like to know what
> > behavior this property changes, and if and how it can
> affect the rest
> > of my application.
> >
> > I've read that if this property is enabled, the developer needs to
> > trim all fielsd by hand, but the test below doesn´t show
> this, so i´m
> > probably misunderstanding the docs:
> >
> > Database.DefaultNoTrimming := True;
> > Q.SQL.Text := 'select nome from cad1 where numcad1 = 0'); Q.Open;
> > ShowMessage('*' + Q.FieldByName('nome').AsString + '*');
> >
> > It shows "*<name>*", without trailing spaces.
> >
> > So what does this IBO trims when 'DefaultNoTrimming' is False?
> >
> > Regards,
> >
> > Fabiano
> >
> >
> > ------------------------------------
> >