FillWithDASQL error

Hi,
I applied the following SQL statement that return “field not found”. How to solve it? I need to use same field to handle DBLookupCombo because it has multiple language description.

SELECT SDC_guid, SDC_code, SDC_CHSDesc AS DeptDesc FROM SampleDepartment

Hi,

Can you show declaration of SampleDepartment in schema modeller, pls?

Hi,
Are you need this?

Logged as bugs://D19266.

Hi,

I can reproduce that AS keyword doesn’t work as expected

Hi,

update uDASQLQueryProcessor.pas as

procedure TQueryProcessor.VisitSelect(action: TSelectAction);
...
        list.Add(s);
        action.ResultTable.Fields[i].SQLOrigin :=s;
        action.ResultTable.Fields[i].Name := s;  // <<<<< added

bugs://D19266 was closed as fixed.

Hi,
I added your suggestion and recompile all files (includes my application). But it also can’t show the correct field name.

Hi,

odd. it works on my side:

can you create a simple testcase, pls?
you can drop email to support@ for keeping privacy

Hi,
I’m not doing in Schema Modeler. It is using in client side.

DASQL3 := ‘SELECT SDC_guid, SDC_code, SDC_CHSDesc AS DeptDesc FROM SampleDepartment’;
ClientDataModule.RemoteDataAdapter.FillWithDASql([SMPDept], [DASQL3], [nil]);

Hi,

the issue was that sql like SELECT SDC_guid, SDC_code, SDC_CHSDesc AS DeptDesc FROM SampleDepartment returned 3 fields :

  • SDC_guid
  • SDC_code
  • SDC_CHSDesc instead of DeptDesc

now it should return DeptDesc as 3rd field.

Have you caught another issue? in DA SQL itself?

Hi,
I got the different result with you.

Hi,

try to close Delphi IDE and launch C:\Program Files (x86)\RemObjects Software\Build\install_DA.cmd with admin rights.

it should rebuild .dcu, .dcp and .bpl

Hi,
I tried your suggestion and then rebuild all DA and client. The result is the same that can’t show the correct field name.

Hi,
I created the simple testcase by email. Please check it.

Hi,

you can update field’s DisplayLabel too as

procedure TQueryProcessor.VisitSelect(action: TSelectAction);
...
        list.Add(s);
        action.ResultTable.Fields[i].SQLOrigin :=s;
        if action.ResultTable.Fields[i].DisplayLabel = action.ResultTable.Fields[i].Name then  // added
          action.ResultTable.Fields[i].DisplayLabel := s; //added
        action.ResultTable.Fields[i].Name := s;           //added

Hi,
I tested it works fine. Thanks a lot. Does it include in next version?

Hi,

of course