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;
- 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 ?