I use lazarus 1.8.0 in linux x64 and zeos 7.2.6 and firebird 2.5. The database has WIN1252 as a code page.
ZConnection is set:
ClientCodePAge WIN1252
ControlsCodePage cCP_UTF8
ZQuery.SQL is "select * from home"
I click twice on ZQUERY and add the static fields.
The problem is that the size is wrong. For example
The "ID" field
In the DB it is varchar (10)
in lazarus it assigns me size = 40. This creates problems when I insert long strings generating exception in the database. :'( :'(
How can I solve it?
Field size problem with linux and firebird
- cappelletto
- Fresh Boarder
- Posts: 18
- Joined: 17.06.2020, 10:55
- Location: Italy
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Field size problem with linux and firebird
Hello,
this problem cannot be solved on Zeos 7.2. Please try Zeos 7.3. You can check it out using subversion or download a snapshot from our Subversion page.
Bestz regards,
Jan
this problem cannot be solved on Zeos 7.2. Please try Zeos 7.3. You can check it out using subversion or download a snapshot from our Subversion page.
Bestz regards,
Jan
- cappelletto
- Fresh Boarder
- Posts: 18
- Joined: 17.06.2020, 10:55
- Location: Italy
Re: Field size problem with linux and firebird
OK.
Is it reliable to use this version in production? On a server?
Thank you
Is it reliable to use this version in production? On a server?
Thank you
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Field size problem with linux and firebird
Zeos 7.3 should be reliable to use. We currently prepare to have it go into beta state. There are no big changes planned anymore.
All in all your possibilities are:
All in all your possibilities are:
- Use Zeos 7.3. There we have our own fields, that can give the correct value vor size. Make sure, your whole environment it using UTF8. Use cCP_UTF8.
- Use Zeos 7.2 but know that for TStringField the Size property is always (4 * Character Count) if ControlsCodepage is cCP_UTF8. For pure server applications that might be an option.
- Use Zeos 7.2, set ControlsCodepage to cCP_GETACP. In this scenario Zeos will ask the OS about the character set in use. If that character set uses 1 byte per character, the Size property will be correct. This mostly makes sense on Windows. But be aware that problems might arise if you need to interface to components that expect UTF8 - like the Lazarus LCL.
- cappelletto
- Fresh Boarder
- Posts: 18
- Joined: 17.06.2020, 10:55
- Location: Italy
Re: Field size problem with linux and firebird
In 7.3, there is a problem with the TZStoredprocs. Parameter assignment does not work.
es:
TesProc.ParamByName('cli').AsInteger := 1;
It gives me the error: Parameter "cli" not found.
In addition to the transition between 7.2 and 7.3 I lose all the parameters and I have to recreate them
es:
TesProc.ParamByName('cli').AsInteger := 1;
It gives me the error: Parameter "cli" not found.
In addition to the transition between 7.2 and 7.3 I lose all the parameters and I have to recreate them
- cappelletto
- Fresh Boarder
- Posts: 18
- Joined: 17.06.2020, 10:55
- Location: Italy
Re: Field size problem with linux and firebird
The problem is that with linux I can't set cCP_GETACP, otherwise I would be fine with this. With linux it gives me the possibility to choose cCP_UTF8 or cCP_UTF16, but not cCP_GETACP.
Is there any way to set cCP_GETACP?
Is there any way to set cCP_GETACP?
marsupilami wrote: ↑17.06.2020, 15:26 Zeos 7.3 should be reliable to use. We currently prepare to have it go into beta state. There are no big changes planned anymore.
All in all your possibilities are:My suggestion: Stick to option number 1.
- Use Zeos 7.3. There we have our own fields, that can give the correct value vor size. Make sure, your whole environment it using UTF8. Use cCP_UTF8.
- Use Zeos 7.2 but know that for TStringField the Size property is always (4 * Character Count) if ControlsCodepage is cCP_UTF8. For pure server applications that might be an option.
- Use Zeos 7.2, set ControlsCodepage to cCP_GETACP. In this scenario Zeos will ask the OS about the character set in use. If that character set uses 1 byte per character, the Size property will be correct. This mostly makes sense on Windows. But be aware that problems might arise if you need to interface to components that expect UTF8 - like the Lazarus LCL.
Re: Field size problem with linux and firebird
@cappelletto,
Pause a moment with a migration to 7.3.
For me, StoredProc, e.g. in MySQL (Delphi XE2), behave strangely, too.
Michal
Pause a moment with a migration to 7.3.
For me, StoredProc, e.g. in MySQL (Delphi XE2), behave strangely, too.
Michal
Re: Field size problem with linux and firebird
@All,
It seems that in ZEOS 7.3_r6654 Michael has corrected the error and now StoredProc should work.
Michal
It seems that in ZEOS 7.3_r6654 Michael has corrected the error and now StoredProc should work.
Michal
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Field size problem with linux and firebird
Hello
So if you absolutely need the Size property to be correct, you only can stick to Zeos 7.3 and report any problems you find here on the forums or - even better - on the bug tracker.
Best regards,
Jan
On most Linux systems this would not help because GETACP would return UTF8. This is the default on most Linux distos these days. Zeos would behave the same as with cCP_UTF8 in that case.cappelletto wrote: ↑17.06.2020, 16:04 The problem is that with linux I can't set cCP_GETACP, otherwise I would be fine with this. With linux it gives me the possibility to choose cCP_UTF8 or cCP_UTF16, but not cCP_GETACP.
Is there any way to set cCP_GETACP?
So if you absolutely need the Size property to be correct, you only can stick to Zeos 7.3 and report any problems you find here on the forums or - even better - on the bug tracker.
Best regards,
Jan