Page 1 of 1

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

Posted: Fri 20 Jul 2012 10:53
by jerduval
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 ?

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

Posted: Mon 23 Jul 2012 10:44
by ZEuS
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.

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

Posted: Mon 23 Jul 2012 12:14
by jerduval
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.

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

Posted: Mon 10 Sep 2012 09:55
by jerduval
Hello,
Could you tell when the next release will be available ?
Regards,
Jerome DUVAL
Holy-Dis

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

Posted: Mon 10 Sep 2012 11:22
by AndreyZ
We will release all dbExpress drivers in two or three days.

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

Posted: Tue 18 Dec 2012 17:04
by jerduval
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

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

Posted: Wed 19 Dec 2012 11:16
by ZEuS
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).