Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Master-Detail relationship error


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


Permlink Replies: 1 - Last Post: Jun 23, 2014 6:42 AM Last Post By: Dmitry Arefiev
Paulo Mariano

Posts: 29
Registered: 11/25/12
Master-Detail relationship error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 18, 2014 2:10 PM
Hello.

In an application created with Delphi XE6, which accesses an Informix database via FireDAC, two TFDQuery objects, StoreQuery (master) and RegisQuery (detail), have been defined according to the guidelines provided on page [http://docwiki.embarcadero.com/RADStudio/XE5/en/Master-Detail_Relationship_%28FireDAC%29].

These are some of the properties of the mentioned queries:
object StoreQuery: TFDQuery
    OnNewRecord = StoreQueryNewRecord
    SQL.Strings = (
      'select contc_store, contc_name, contc_address1, contc_address2, contc_city, contc_phone, contc_warehouse, contc_status, contc_zip,'
      ' contc_state, contc_type, contc_bus_phone, contc_svc_phone, club_abr, contc_corp_id, statement_text, remit_to, remit_address1,'
      ' remit_address2, remit_city, remit_state, remit_zipcode, gl_company_id,  contc_gl_split_store_id from asacontc order by contc_store')
    Left = 327
    Top = 8
    object StoreQuerycontc_store: TSmallintField
      DisplayLabel = 'Store ID'
      FieldName = 'contc_store'
    end    
    .
    .
    .
end
 
object regisQuery: TFDQuery
    BeforePost = regisQueryBeforePost
    OnNewRecord = regisQueryNewRecord
    MasterSource = StoreSource
    MasterFields = 'contc_store'
    SQL.Strings = (
      'select '
      'ttyr_tty,ttyr_store, ttyr_location, '
      'ttyr_manager, ttyr_opening_draw,'
      'ttyr_opening_desc, ttyr_status, ttyr_config '
      'from aspttyr '
      'where ttyr_store=:contc_store')
    Left = 383
    Top = 7
    ParamData = <
      item
        Name = 'contc_store'
        DataType = ftSmallint
        ParamType = ptInput
        Size = 2
      end>
    .
    .
    .
end

The queries are open via the following statements:

StoreQuery.Open;
RegisQuery.Open;

When the second statement is executed, the following exception is raised:
Project app.exe raised exception class EFDException with message '[FireDAC][Stan][Eval]-100. Column or function [N] is not found. Hint: if the name is a function name, then add FireDAC.Stan.ExprFuncs to uses clause'.

I would appreciate if some assistance could be provided to solve the problem.
Thank you in advance.

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Master-Detail relationship error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 23, 2014 6:42 AM   in response to: Paulo Mariano in response to: Paulo Mariano
Project app.exe raised exception class EFDException with message '[FireDAC][Stan][Eval]-100. Column or function [N] is not found. Hint: if the name is a function name, then add FireDAC.Stan.ExprFuncs to uses clause'.

Somewhere you have an expression, which references to "N". Check properties:
- TField.CustomConstraint
- TField.DefaultExpression
- TField.ImportedConstraint

Also check:
- TFDQuery.Filter
- TFDQuery.Constraints
- TFDQuery.Indexes

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

Server Response from: ETNAJIVE02