Migration from FB4 to FB5, Delphi, input parameters "incorrect values within SQLDA structure"

259 views
Skip to first unread message

A. Casati

unread,
Sep 10, 2024, 12:43:25 PM9/10/24
to firebird-support
I am currently using FB4 with DataTypeCompatibility = 2.5

It works great with an old application using Borland Database Engine components and GDS32.dll (created with instclient.exe).

I did a backup with FB4, uninstalled FB4, installed FB5 and restored from the backup.

FB5 has the same configuration as it was under FB4, but when my app opens a query using parameters, I get the exception "incorrect values within SQLDA structure".

Everything works fine if I do NOT use parameters in query.

Whats has changed, and not documented, from FB4 with params and DataTypeCompatibility?

Thank you

Ismael L. Donis Garcia

unread,
Sep 10, 2024, 1:16:03 PM9/10/24
to firebird...@googlegroups.com
Try creating the following trigger inside the database:
 
SET TERM ^ ;
 
CREATE TRIGGER SET_BIND_AC ACTIVE
 ON CONNECT POSITION 0
AS
BEGIN
  set bind of timestamp with time zone to legacy;
  set bind of time with time zone to legacy;
  set bind of int128 to legacy;
  set bind of decfloat to legacy;
END^
 
SET TERM ; ^
 
Best Regards
--
Ismael
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/adcccc74-4663-4e3d-86a2-90b65d33986bn%40googlegroups.com.

Mark Rotteveel

unread,
Sep 10, 2024, 1:48:08 PM9/10/24
to firebird...@googlegroups.com
On 10/09/2024 19:15, Ismael L. Donis Garcia wrote:
> Try creating the following trigger inside the database:
> SET TERM ^ ;
> CREATE TRIGGER SET_BIND_AC ACTIVE
>  ON CONNECT POSITION 0
> AS
> BEGIN
>   set bind of timestamp with time zone to legacy;
>   set bind of time with time zone to legacy;
>   set bind of int128 to legacy;
>   set bind of decfloat to legacy;
> END^
> SET TERM ; ^

This is unnecessary if DataTypeCompatibility is configured in firebird.conf.

Mark
--
Mark Rotteveel

Virgo Pärna

unread,
Sep 11, 2024, 1:37:04 AM9/11/24
to firebird...@googlegroups.com
On 10.09.2024 16:42, A. Casati wrote:
> FB5 has the same configuration as it was under FB4, but when my app
> opens a query using parameters, I get the exception "incorrect values
> within SQLDA structure".
>
> Everything works fine if I do NOT use parameters in query.

How did it even work with FB4? SQL queries using parameters stopped
working with BDE Interbase driver already with Firebird 3.0.

--
Virgo Pärna
Gaiasoft OÜ
vi...@gaiasoft.ee

Virgo Pärna

unread,
Sep 11, 2024, 4:14:54 AM9/11/24
to firebird...@googlegroups.com
On 11.09.2024 08:36, Virgo Pärna wrote:
> On 10.09.2024 16:42, A. Casati wrote:
>> FB5 has the same configuration as it was under FB4, but when my app
>> opens a query using parameters, I get the exception "incorrect values
>> within SQLDA structure".
>>
>> Everything works fine if I do NOT use parameters in query.
>
>     How did it even work with FB4? SQL queries using parameters stopped
> working with BDE Interbase driver already with Firebird 3.0.
>

Although, the error I got at 2015 was:
"General SQL error.
SQLDA missing or incorrect version, or incorrect number/type of
variables
Invalid SQLDA version"

Andrea Casati

unread,
Sep 11, 2024, 4:27:42 AM9/11/24
to firebird...@googlegroups.com
This is not correct, as using "DataTypeCompatibility = 2.5" in
databases.conf does the good job.
I am currently using BDE and FB4 with no problem at all, with plenty of
tables, stored procedures and applications.
I was expecting the same behaviour on FB5, because I did not find any
"compatibility" issue regarding FB4.

Mark Rotteveel

unread,
Sep 11, 2024, 4:34:12 AM9/11/24
to firebird...@googlegroups.com
What is the result of

select RDB$CONFIG_VALUE
from RDB$CONFIG
where RDB$CONFIG_NAME = 'DataTypeCompatibility'

Mark
--
Mark Rotteveel

A. Casati

unread,
Sep 11, 2024, 6:29:47 AM9/11/24
to firebird-support
RDB$CONFIG_VALUE='2.5'

Vlad Khorsun

unread,
Sep 11, 2024, 8:44:26 AM9/11/24
to firebird-support
I am currently using FB4 with DataTypeCompatibility = 2.5

It works great with an old application using Borland Database Engine components and GDS32.dll (created with instclient.exe).

I did a backup with FB4, uninstalled FB4, installed FB5 and restored from the backup.

FB5 has the same configuration as it was under FB4, but when my app opens a query using parameters, I get the exception "incorrect values within SQLDA structure".

  Make sure your app using correct Firebird client library - as it was when you using FB4
 
Everything works fine if I do NOT use parameters in query.

Whats has changed, and not documented, from FB4 with params and DataTypeCompatibility?
 
  I don't remember such changes. If you sure all is correct at your side - provide minimal reproducible test case, please.

Regards,
Vlad

A. Casati

unread,
Sep 11, 2024, 10:26:00 AM9/11/24
to firebird-support
Thank you, I managed to resolve (remeber) the issue.
The app works using the client library gds32.dll created out from FB2.5.

Client FB4 and FB5 cannot work with BDE using the native library.

A. Casati

unread,
Sep 11, 2024, 11:51:27 AM9/11/24
to firebird-support
I am investigating about an issue using FB2.5 client with FB5 server, related to blob fields.

Virgo Pärna

unread,
Sep 12, 2024, 2:27:29 AM9/12/24
to firebird...@googlegroups.com
On 11.09.2024 17:26, A. Casati wrote:
>
> The app works using the client library gds32.dll created out from FB2.5.
>

Ok, that explains why 3.0 was already broken for me. Because I was
testing with 3.0 gds32.dll. And I did not consider 2.5 one, because that
would have required configuring server for legacy authentication.

Alexander Skara

unread,
Sep 23, 2024, 8:37:34 AM9/23/24
to firebird-support
I have met similar message (more complete 'SQLSTATE[HY000]: General error: -804 Incorrect values within SQLDA structure empty pointer to NULL indicator variable at SQLVAR index 0  ') when I am trying to call SQL queries from Yii2 with some fb or ib driver. And these messages appeared only when my query had 2 or more parameters with the same name, e.g. :id_organisation and :id_organisation. It was very important to make the parameters names unique for each query although they, of course, can have equal values. Maybe that helps for the Desktop and BDE as well.

p.s. we managed to move from BDE to IBX and/or Zeos some time ago. BDE is more closed source (IBX and Zeos components have debuggable and modifiable source) and BDE has limits on the data it can proces, it was some 500MB or maybe 1GB which may be insufficient for large reports.

Alex

Dimitry Sibiryakov

unread,
Sep 23, 2024, 8:41:15 AM9/23/24
to firebird...@googlegroups.com
Alexander Skara wrote 23.09.2024 14:37:
> I have met similar message (more complete 'SQLSTATE[HY000]: General error: -804
> Incorrect values within SQLDA structure empty pointer to NULL indicator variable
> at SQLVAR index 0 ') when I am trying to call SQL queries from Yii2 with some fb
> or ib driver. And these messages appeared only when my query had 2 or more
> parameters with the same name, e.g. :id_organisation and :id_organisation.

It means that these drivers incorrectly handle such parameters providing no
way for fbclient to report NULL state for nullable parameter.
Either they have to set sqlind member or sqltype without nullable flag.

--
WBR, SD.

Tim Crawford

unread,
Sep 23, 2024, 8:13:13 PM9/23/24
to firebird-support

I was going to say that but couldn't be sure that was it..

I have upgraded to using FB 3 for an ancient FB 1.5 dialect 1 application and thought it was no go because of thE SQLDA error. Thanks for reminding me of what I di to fix it!

Tim

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages