Subject | Re: [IBO] TIB_ColumnText and strings that are too long |
---|---|
Author | Martijn Tonies |
Post date | 2006-01-10T06:45:59Z |
Hello Jason,
back my data
from the database - that is has been cut off, while if I would have gotten a
database
error, it would have been clear from the start.
Could this behaviour be optional? (default ON not to annoy other IBO users,
or
perhaps default OFF to make sure errors happen when they should?)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> I designed it to work the way it does. To my knowledge other componentsets
> also work this way.Well, ADO, for one, doesn't.
> The best way to get an error message is to write a generic validationThe thing is, as I wrote earlier, as a user, I do not know - until I get
> routine. It could be a procedure that assigns an open string value to a
> TIB_Column and inside it will do the check.
back my data
from the database - that is has been cut off, while if I would have gotten a
database
error, it would have been clear from the start.
Could this behaviour be optional? (default ON not to annoy other IBO users,
or
perhaps default OFF to make sure errors happen when they should?)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> Jason___________________________________________________________________________
>
> > -----Original Message-----
> > From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> > Behalf Of Martijn Tonies
> > Sent: Monday, January 09, 2006 4:18 AM
> > To: ibobjects@yahoogroups.com
> > Subject: [IBO] TIB_ColumnText and strings that are too long
> >
> >
> > Hi,
> >
> > I'm using a TIB_DSQL component and parameters to insert data
> > into a table.
> >
> > I have a VARCHAR(20) defined in the database.
> >
> > Now I'm assigning a value of length 60 to it.
> >
> > It did not generate an error.
> >
> > So, I started looking through IBO-source. It seems that TIB_ColumnText
> > only moves the "sqllen" characters into the buffer:
> >
> > procedure TIB_ColumnText.SetValue( const NewValue: string );
> > var
> > tmpVal: string;
> > strLen: integer;
> > begin
> > tmpVal := NewValue;
> > SysBeforeModify;
> > case CharCase of
> > ccUpper: tmpVal := AnsiUpperCase( tmpVal );
> > ccLower: tmpVal := AnsiLowerCase( tmpVal );
> > end;
> > if not Row.IsKeyFields then
> > ApplyTrimming( tmpVal, Trimming );
> > strLen := Length( tmpVal );
> > FillChar( FNewColumnBuffer^, DataSize, FPadChar );
> > if ( strLen = 0 ) and FBlankIsNull then
> > SysSetIsNull( true )
> > else
> > begin
> > SysSetIsNull( false );
> >
> > /* here!! */
> >
> > if strLen > SQLLen then
> > strLen := SQLLen;
> > Move( tmpVal[1], FNewColumnBuffer^, strLen );
> > end;
> > SysAfterModify;
> > end;
> >
> > If the string is too long, it will only copy "SQLLen" number of
> > characters...
> >
> > All fine and dandy, but I WANT it to return an error. How
> > else would I know
> > that my data
> > has been cut off?
> >
> > Any ideas?
> >
> > Martijn Tonies
> > Database Workbench - tool for InterBase, Firebird, MySQL,
> > Oracle & MS SQL
> > Server
> > Upscene Productions
> > http://www.upscene.com
> > Database development questions? Check the forum!
> > http://www.databasedevelopmentforum.com
> >
> >
> >
> > ______________________________________________________________
> > _____________
> > IB Objects - direct, complete, custom connectivity to
> > Firebird or InterBase
> > without the need for BDE, ODBC or any other layer.
> > ______________________________________________________________
> > _____________
> > http://www.ibobjects.com - your IBO community resource for
> > Tech Info papers,
> > keyword-searchable FAQ, community code contributions and more
> > !
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
> IB Objects - direct, complete, custom connectivity to Firebird orInterBase
> without the need for BDE, ODBC or any other layer.___________________________________________________________________________
>
> http://www.ibobjects.com - your IBO community resource for Tech Infopapers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>
>