Board index » delphi » Large Varchar Field

Large Varchar Field

I have declared a large Varchar field 1000 characters. I'm using a
TDBMemo to insert a value via a Tibdataset, After about 300 characters I
get a string truncation error from IBX every time I try to post changes.
   After the error has occured the data is still posted to the database.
Any ideas whats going on, and how to avoid this.
 

Re:Large Varchar Field


In article <3C9F9DD1.7040...@orange.net>, wil...@orange.net says...

Quote
> I have declared a large Varchar field 1000 characters. I'm using a
> TDBMemo to insert a value via a Tibdataset, After about 300 characters I
> get a string truncation error from IBX every time I try to post changes.

        What is the exact text of the error message you see?  "An error"
doesn't give much information.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Large Varchar Field


The message is EIBInterbaseError with message arithmetic exception,
numeric overflow,  or string truncation

Re:Large Varchar Field


That message comes from the server when you try to store something larger than
the definition for the column.

Quote
Will Honor wrote:

> The message is EIBInterbaseError with message arithmetic exception,
> numeric overflow,  or string truncation

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
This sad little lizard told me that he was a brontosaurus on his mother's
side.  I did not laugh; people who boast of ancestry often have little else
to sustain them.  Humoring them costs nothing and adds to happiness in
a world in which happiness is in short supply.   (RAH)

Re:Large Varchar Field


Thats strange because the column is defined as a VARCHAR(1000) and I'm
using a dbMemo to put about 300 characters into it. Why does the server
feel that the string is too long? the error also occurs when I use the
DBMemo to edit a record with a long entry. So the string can be read
from the database OK but when it comes to putting back even a shorter
string than before I get the error. Any Ideas?

Quote
Jeff Overcash (TeamB) wrote:
> That message comes from the server when you try to store something larger than
> the definition for the column.

> Will Honor wrote:

>>The message is EIBInterbaseError with message arithmetic exception,
>>numeric overflow,  or string truncation

Re:Large Varchar Field


In article <3CA04376.8010...@orange.net>, wil...@orange.net says...

Quote

> Thats strange because the column is defined as a VARCHAR(1000) and I'm
> using a dbMemo to put about 300 characters into it. Why does the server
> feel that the string is too long?

        Use TIBSQLMonitor to figure out what's really going to the server.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Large Varchar Field


I jsut tried this and I can't duplicate it.  IBX client side truncates to the
size param of the TField before sending it to the server.  I could put more than
1000 characters in the memo and it would store the first 1000, the maximum that
the field could contain.  You are on the latest version right?

Quote
Will Honor wrote:

> Thats strange because the column is defined as a VARCHAR(1000) and I'm
> using a dbMemo to put about 300 characters into it. Why does the server
> feel that the string is too long? the error also occurs when I use the
> DBMemo to edit a record with a long entry. So the string can be read
> from the database OK but when it comes to putting back even a shorter
> string than before I get the error. Any Ideas?

> Jeff Overcash (TeamB) wrote:

> > That message comes from the server when you try to store something larger than
> > the definition for the column.

> > Will Honor wrote:

> >>The message is EIBInterbaseError with message arithmetic exception,
> >>numeric overflow,  or string truncation

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
This sad little lizard told me that he was a brontosaurus on his mother's
side.  I did not laugh; people who boast of ancestry often have little else
to sustain them.  Humoring them costs nothing and adds to happiness in
a world in which happiness is in short supply.   (RAH)

Re:Large Varchar Field


I checked using SQLmonitor and it seems that the error occurs before any
  sql is sent to the server. Any SQL that is sent seems fine.
I then decided to write a little test app to send to you guys, Same
database same updates and guess what, It works properly. Looks like
theres something wrong with my app although I can't figure out what it
is. I think I might use BLOB fields instead.
    Thanks for your help.

Re:Large Varchar Field


If you have instantiated the TField then check the size of that TField.  You
might have changed the DB side at some time and the persistent field is still
seeing the size as it was when it was created.

Quote
Will Honor wrote:

> I checked using SQLmonitor and it seems that the error occurs before any
>   sql is sent to the server. Any SQL that is sent seems fine.
> I then decided to write a little test app to send to you guys, Same
> database same updates and guess what, It works properly. Looks like
> theres something wrong with my app although I can't figure out what it
> is. I think I might use BLOB fields instead.
>     Thanks for your help.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
This sad little lizard told me that he was a brontosaurus on his mother's
side.  I did not laugh; people who boast of ancestry often have little else
to sustain them.  Humoring them costs nothing and adds to happiness in
a world in which happiness is in short supply.   (RAH)

Re:Large Varchar Field


Quote
"Will Honor" <wil...@orange.net> wrote in message

news:3CA0C3E8.5020301@orange.net...

Quote
> I checked using SQLmonitor and it seems that the error occurs before any
>   sql is sent to the server. Any SQL that is sent seems fine.
> I then decided to write a little test app to send to you guys, Same
> database same updates and guess what, It works properly. Looks like
> theres something wrong with my app although I can't figure out what it
> is. I think I might use BLOB fields instead.

You are much better off using blobs here. My rule is anything over a couple
hundred bytes should be a blob.

--
Wayne Niddery (Logic Fundamentals, Inc.)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
In a tornado, even turkeys can fly. - unknown

Re:Large Varchar Field


Thanks for your help guys,
   I wasnt using persistant fields and I didnt change the size of the
varchar at any point. Its strange that it doesnt work in my main app but
works perfectly in anything else I do. Sods law I suppose, I'm now using
BLOB fields on the database and they work fine.
                                   Regards Will.

Re:Large Varchar Field


Hi Will,
Is the value of the varchar field containing special characters like accents
(, ?)? This can cause an error if the defined character set of the field is
not supporting this.

I hope a future version of Interbase will use compressed client-server
traffic (or at least will trim spaces of char and varchar fieldvalues on
transfer).
This will speed up Interbase a lot.

Bye,
Robert

"Will Honor" <wil...@orange.net> schreef in bericht
news:3C9F9DD1.7040106@orange.net...

Quote
> I have declared a large Varchar field 1000 characters. I'm using a
> TDBMemo to insert a value via a Tibdataset, After about 300 characters I
> get a string truncation error from IBX every time I try to post changes.
>    After the error has occured the data is still posted to the database.
> Any ideas whats going on, and how to avoid this.

Re:Large Varchar Field


Quote
Robert wrote:

> Hi Will,
> Is the value of the varchar field containing special characters like accents
> (, ?)? This can cause an error if the defined character set of the field is
> not supporting this.

> I hope a future version of Interbase will use compressed client-server
> traffic (or at least will trim spaces of char and varchar fieldvalues on
> transfer).
> This will speed up Interbase a lot.

IB 6.5 already does this.  It only transfers the characters, trailing white
space is not transmitted unlike 6.0 and earlier.  

Quote

> Bye,
> Robert

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
This sad little lizard told me that he was a brontosaurus on his mother's
side.  I did not laugh; people who boast of ancestry often have little else
to sustain them.  Humoring them costs nothing and adds to happiness in
a world in which happiness is in short supply.   (RAH)

Re:Large Varchar Field


Quote
> > I hope a future version of Interbase will use compressed client-server
> > traffic (or at least will trim spaces of char and varchar fieldvalues on
> > transfer).
> IB 6.5 already does this.  It only transfers the characters, trailing
white
> space is not transmitted unlike 6.0 and earlier.

Ok,
I could not find this in the fact sheet of Interbase 6.5.
Sounds like a good selling argument :)
Bye,
Robert.

Other Threads