Recent

Author Topic: [SOLVED] Fields being Truncated  (Read 12312 times)

Stag76

  • New Member
  • *
  • Posts: 35
[SOLVED] Fields being Truncated
« on: October 11, 2012, 01:35:33 pm »
I've been using Lazarus v0.9.30 and ZEOS-6.6.6-Stable to extract data in a migration project from FireBird 1.5 DataBases for a year without problem, but, after updating to Lazarus v1.0 and ZEOS 7.0.1-Beta, I find that Varchar fields are being truncated when they are read from the FireBird DataBase. The truncation varies from 1 to 3 or 4 right side characters as far as I can make out. Has anybody else seen this?
« Last Edit: October 15, 2012, 11:43:07 pm by Stag76 »

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Fields being Truncated
« Reply #1 on: October 11, 2012, 01:41:20 pm »
Are there any UTF8 non ASCII characters in the VarChar fields?

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #2 on: October 11, 2012, 01:56:33 pm »
No, they're just text. An example is 'Street' is truncated to 'Stree', and 'AN' truncated to 'A'.

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: Fields being Truncated
« Reply #3 on: October 11, 2012, 02:29:48 pm »
Can you give me a simple table and a little testcase for that? The 6.6.6 di determine the field-size oversized but it might be possible that i made a mistake for that case.  :o Is that field a VARYING char field?

ZeosDevTem

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #4 on: October 11, 2012, 02:52:29 pm »
I have a table (548 rows) of FireBird 1.5 fields, defined as Varchar (eight) . (If I use the number 8 in brackets it translates to a face). These are all being truncated to 2 characters. eg 'ANDRDE' is truncated to 'AN'. I can extract the Data to a SpreadSheet if that helps.
« Last Edit: October 11, 2012, 02:54:02 pm by Stag76 »

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: Fields being Truncated
« Reply #5 on: October 11, 2012, 03:07:48 pm »
Nope i don't need a script. Hmm this is looking like a version issue to me. I've testet these modifications with FB2.5 where the Server returns Varchar(40)*SizeOf(ChracterSetChar)+SizeOf(ChracterSetChar) which means i got 123 Bytes for UTF8 as result for all SQL_VARYING types.

To determine the ColumnDisplaySize i go that way backwards.

Can you test the latest \testing branch before reacting by coding? It might be possible we've bundled a wrong rev. to this package...


Edit: What i don't know is: How does FB1.5 behave in this case?
« Last Edit: October 11, 2012, 03:12:17 pm by EgonHugeist »

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #6 on: October 11, 2012, 03:18:52 pm »
How do I get the latest testing branch to test it?

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: Fields being Truncated
« Reply #7 on: October 11, 2012, 03:20:19 pm »

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: Fields being Truncated
« Reply #8 on: October 11, 2012, 03:40:27 pm »
Sorry was a deprecated urL.

Have a look here: http://zeos.firmos.at/viewtopic.php?t=3431

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #9 on: October 11, 2012, 03:48:48 pm »
Sorry...this is beyond my capabilities.

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: Fields being Truncated
« Reply #10 on: October 11, 2012, 07:46:10 pm »
I'll download a FB1.5 and test it and give you a reply the next two days.

But if that was a bug of me than is now way around to use the SVN instead of the Beta-package.

Best regards,

Michael

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #11 on: October 11, 2012, 09:38:30 pm »
Thanks very much. In the meantime, I'll try to work through the testing branch download.

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: Fields being Truncated
« Reply #12 on: October 11, 2012, 09:54:23 pm »
Added a VirtualBox with Vista32,
Installed Lazarus 1.0.2 and FPC 2.6 (download package of SF.NET)
Installed FireBird1.5 and FlameRobin 0.9.2(to see a different behavior)
Downloaded and installed the Zeos-7.0.1-Beta package also from SF.NET

Created a DataBase with Charset Unicode_FSS and a simple table with some varchar fields in same CharSet as the DB uses with different sizes to verify the issue.

Made a simple Grid-App and:::: :o No issues to see.   :-\

Now this makes me curious. Where are the differences?  %)

Edit: Some more Details:

Database created with flamerobin. Have 3 VARCHAR fields, size 7,8,9 AND i can use the full size. No values are trunked.
Had a mistake on my previous post: Field.Size(90) := Varchar(30)*Bytes/Char(3->Unicode_FSS)

Which Charset did you use before? Can you see diffenrence with my settings?
« Last Edit: October 11, 2012, 10:05:42 pm by EgonHugeist »

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #13 on: October 11, 2012, 10:59:05 pm »
I'll duplicate what you have done.
My FireBird 1.5 Databases are ones that were migrated (5 years ago) from Interbase.
The only difference I can see is that they have CharSet = NONE.

Stag76

  • New Member
  • *
  • Posts: 35
Re: Fields being Truncated
« Reply #14 on: October 11, 2012, 11:20:04 pm »
I'm downloading Lazarus 1.0.2-fpc-win32 to re-install.

Which Version of ZEOS is recommended? Will 6.6.6-Stable work with this version of Lazarus, or will I have to
use a later one?

 

TinyPortal © 2005-2018