Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: FireDAC exception - Data type is unknown


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


Permlink Replies: 1 - Last Post: Jul 18, 2014 3:42 AM Last Post By: Dmitry Arefiev
Paulo Mariano

Posts: 29
Registered: 11/25/12
FireDAC exception - Data type is unknown  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 17, 2014 12:04 PM
Hello.

In an application built with Delphi XE6, which accesses an Informix database, the following exception is raised:
Project app.exe raised exception class EFDException with message '[FireDAC][Phys][Infx]-335. Parameter [CASHIER] data type is unknown. Hint: specify TFDParam.DataType or assign TFDParam value before Prepare/Execute call'

The query associated with the exception is the following:
with CashierQuery do
  begin
    if not Prepared then
    begin
      SQL.Clear;
      Connection := FDManager.Connections[0];
      SQL.Add('select *');
      SQL.Add('  from table1');
      SQL.Add('  where col1 = :cashier');
      SQL.Add('        and col2 = store');
      SQL.Add('        and col3 = register');
      Prepared := True;
    end;
    if CashierQuery.Active then
      CashierQuery.Close;
    Params[0].AsString := FCashier;
    CashierQuery.Open;


Although the exception provides a hint to solve the problem, I was wondering if there is an alternate (an maybe more efficient) solution to solve the problem.
I explain: the mentioned application, which is being converted from BDE to FireDAC, has innumerous queries implemented this way.

Thank you in advance.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC exception - Data type is unknown  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2014 3:42 AM   in response to: Paulo Mariano in response to: Paulo Mariano
       Prepared := True;


Just remove this line. The query will be automatically prepared on first Open call.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02