Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Error when executing Informix stored procedure via FireDAC


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Aug 27, 2014 3:18 PM Last Post By: Paulo Mariano
Paulo Mariano

Posts: 29
Registered: 11/25/12
Error when executing Informix stored procedure via FireDAC  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 21, 2014 11:54 AM
Hello.

In a test application (developed with Delphi XE5), a connection to an Informix database is successfully established via FireDAC.
When method ExecProc is called to execute a stored procedure, the following exception is raised:
Project FireDAC.exe raised exception class ETDBXNativeException with message '[FireDAC][Phys][TDBX][Informix] Routine (store_token) can not be resolved.'

Here is the code:
FDManager: TFDManager;
FDManager := TFDTestConnection.FDManager; // TFDTestConnection is the class where FDManager and connections are defined; connection is in open state
testStoredProc := TFDStoredProc.Create(Application);
with testStoredProc do 
begin        
    Connection := FDManager.Connections[0];
    storedProcName := 'store_token';
    Params.Clear;
    Params[0].Name := 'cust_no';
    parambyname('cust_no').AsAnsiString := CustCode;
    Params[1].Name := 'tokn';
    parambyname('tokn').AsAnsiString := value.Token;
    Params[2].Name := 'card';
    parambyname('card').AsAnsiString := value.CCardNO;
    Params[3].Name := 'ctype';
    parambyname('ctype').AsAnsiString := value.CCType;
    Params[4].Name := 'expiration';
    parambyname('expiration').AsDateTime := value.CCexpDate;
    Prepare;
    ExecProc;
    result := True;
end;


It is important to point out that:
1) Any stored procedure that has input parameters raises the mentioned exception;
2) Any stored procedure that does not have input parameters runs successfully.

I would appreciate if some assistance could be provided.
Thank you in advance.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Error when executing Informix stored procedure via FireDAC  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 22, 2014 12:25 AM   in response to: Paulo Mariano in response to: Paulo Mariano
XE5 has a bug in this area. It was resolved in XE6 by introducing new native Informix driver.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Paulo Mariano

Posts: 29
Registered: 11/25/12
Re: Error when executing Informix stored procedure via FireDAC  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 18, 2014 1:24 PM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
XE5 has a bug in this area. It was resolved in XE6 by introducing new native Informix driver.

--
With best regards,
Dmitry Arefiev / FireDAC Architect

Hello, Dmitry.

Thank you for your reply.
After updating to XE6, the same exception was raised.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Error when executing Informix stored procedure via FireDAC  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 23, 2014 5:33 AM   in response to: Paulo Mariano in response to: Paulo Mariano
After updating to XE6, the same exception was raised.

Do you use DriverID=Infx ? It is FireDAC Informix native driver,
introduced in RAD Studio XE6.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Paulo Mariano

Posts: 29
Registered: 11/25/12
Re: Error when executing Informix stored procedure via FireDAC  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2014 1:26 PM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Do you use DriverID=Infx ? It is FireDAC Informix native driver, introduced in RAD Studio XE6.

Hello, Dmitry.

Thank you for your reply.
Yes, we do use DriverID = Infx

These are the statements that establish the connection with the database:
begin
  FDConnection := TFDConnection.Create(nil);
 
  if FDManager <> nil then
    FDManager.Free;
  if FDConnection <> nil then
    FDConnection.Free;
  FDManager := TFDManager.Create(nil);
  FDConnection := TFDConnection.Create(nil);
 
  Params := TStringList.Create;
  if (ParamCount > 0) and (Paramstr(1) <> '') then     // server
    Params.Values['Database'] := Paramstr(1)
  else
    Params.Values['Database'] := 'pos';
  if (ParamCount > 1) and (Paramstr(2) <> '') then     // database
    Params.Values['Server'] := Paramstr(2)
  else
    Params.Values['Server'] := 'nwrc';
  Params.Values['User_Name'] := Paramstr(3);
  Params.Values['Password'] := Paramstr(4);
  if (ParamCount > 2) and ((Paramstr(3) <> '') and (Paramstr(4) <> '')) then
    FDConnection.LoginPrompt := False
  else
  begin
    FDConnection.LoginPrompt := True;
  end;
 
  Params.Values['DriverID'] := 'Infx';
  Params.Values['MetaDefSchema'] := 'informix';
  FDConnection.ConnectionDefName := 'testConnection';
  FDManager.AddConnectionDef('testConnection','Infx',Params);
 
  try
    FDManager.Connections[0].Connected := True;
Paulo Mariano

Posts: 29
Registered: 11/25/12
Re: Error when executing Informix stored procedure via FireDAC  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 27, 2014 3:18 PM   in response to: Paulo Mariano in response to: Paulo Mariano
Hello, Dmitry.

I would appreciate if you could provide a feedback based on my previous reply.
Thank you in advance.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02