Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
jerduval
Posts: 23
Joined: Mon 13 Sep 2010 08:33
Location: Colombes, France

Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by jerduval » Fri 20 Jul 2012 10:53

Hello,

We are migrating an application from Delphi 2007 to Delphi XE2 using Firebird databases and we encounter a problem with the TSQLStoredProc parameters name : despite the stored procedure is well created, when accessing the TSQLStoredProc the names of the params are truncated to 10 characters.

It seems to occur only with Firebird 1.5.6 databases, not with Firebird 2.x databases.

Here is a code sample to reproduce :

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  i : integer;
begin
  SQLConnection1.DriverName := 'DevartInterBase';
  SQLConnection1.LibraryName := 'dbexpida40.dll';
  SQLConnection1.VendorLib   := 'fbclient.dll';
  SQLConnection1.GetDriverFunc := 'getSQLDriverInterBase';
  SQLConnection1.Params.Clear;
  SQLConnection1.Params.Values[{!4}'DataBase'] := 'some Firebird 1.5.6 Database...';
  SQLConnection1.Params.Values[{!4}'User_Name'] := 'SYSDBA';
  SQLConnection1.Params.Values[{!4}'Password']  := 'masterkey';
  SQLConnection1.LoginPrompt := false;
  SQLConnection1.Open;
  try
    SqlQuery1.Sql.Clear;
    SqlQuery1.Sql.Add({!4}'CREATE PROCEDURE TEST_STOREDPROC (TEST_PARAMNAME INTEGER)');
    SqlQuery1.Sql.Add({!4}'RETURNS (TEST_RETURNNAME INTEGER) AS');
    SqlQuery1.Sql.Add({!4}'BEGIN');
    SqlQuery1.Sql.Add({!4}'  TEST_RETURNNAME = TEST_PARAMNAME+1;');
    SqlQuery1.Sql.Add({!4}'END;');
    SqlQuery1.SQLConnection := SQLConnection1;
    SQLQuery1.ExecSQL;

    SQLStoredProc1.SQLConnection := SQLConnection1;
    SQLStoredProc1.StoredProcName := 'TEST_STOREDPROC';
    for i := 0 to SQLStoredProc1.Params.Count-1 do
      Memo1.Lines.Add(SQLStoredProc1.Params[i].Name);
  finally
    SQLConnection1.Close;
  end;
end;
When compiled with Delphi 2007, the names added to the memo are correct :
- TEST_PARAMNAME
- TEST_RETURNNAME

When compiled with Delphi XE2, the names added to the memo are truncated to 10 characters :
- TEST_PARAM
- TEST_RETUR

We are using the same dbexpida40.dll (version 3.1.2) in the both cases.
Have we missed something ?

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by ZEuS » Mon 23 Jul 2012 10:44

We have already fixed this problem.
This fix will be included in the next dbExpress driver for InterBase & Firebird build.
For now you can set the UseUnicode parameter of SQLConnection1 to False to avoid the problem.

jerduval
Posts: 23
Joined: Mon 13 Sep 2010 08:33
Location: Colombes, France

Re: Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by jerduval » Mon 23 Jul 2012 12:14

Hello,

Indeed, adding this line will help us avoid the problem until the next build is released.

Code: Select all

SQLConnection1.Params.Values[sUseUnicode] := 'False';
Thanks for your quick answer.

Regards.

jerduval
Posts: 23
Joined: Mon 13 Sep 2010 08:33
Location: Colombes, France

Re: Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by jerduval » Mon 10 Sep 2012 09:55

Hello,
Could you tell when the next release will be available ?
Regards,
Jerome DUVAL
Holy-Dis

AndreyZ

Re: Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by AndreyZ » Mon 10 Sep 2012 11:22

We will release all dbExpress drivers in two or three days.

jerduval
Posts: 23
Joined: Mon 13 Sep 2010 08:33
Location: Colombes, France

Re: Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by jerduval » Tue 18 Dec 2012 17:04

Hello,
We have bought the update of the driver and have tested the same code:
The settings are not truncated anymore but contain several spaces after their "real" name to obtain a fixed length of 32 characters:

Code: Select all

'TEST_PARAMNAME                 '
'TEST_RETURNNAME                '
This time, the problem is present whatever the Firebird version (1.5.6, 2.1.3, 2.5.2).

The work-around you indicated cannot be implemented because we need to manage Unicode in our programs.

Code: Select all

SQLConnection1.Params.Values[sUseUnicode] := 'False';
Looking forward to an early reply.

Jerome DUVAL
Holy-Dis

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Problem with TSQLStoredProc parameters name / dbexpida40.dll v3.1.2

Post by ZEuS » Wed 19 Dec 2012 11:16

Thank you for the information.
We have fixed the issue and will include the fix in the nearest dbExpress driver for InterBase & Firebird build (we plan to release the next build this month).

Post Reply