FiledValue is set to '0' when assigning Uniquery result to Clientdataset

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
adityashirodkar
Posts: 1
Joined: Wed 05 Jul 2017 09:18

FiledValue is set to '0' when assigning Uniquery result to Clientdataset

Post by adityashirodkar » Wed 05 Jul 2017 09:28

I am running a query against a oracle server that fetches along with other columns
one of which is FMTBCD/float column(Number(15,0) ). when I assign data from Uniquery to clientdataset the Field value is '0' for the FMTBCD column when EnableFMTBCD= True. IT works fine when EnableFMTBCD= False.
When I check the filed value in the query result it is there but in clientdataset its '0'

Code: Select all

function ExecSQL(vSql: string): TClientDataSet;
var
  vSQLCDS: TUniQuery;
  vProvide: TDataSetProvider;
  vTempResult: TClientDataSet;
  I :Integer;
begin
  vSQLCDS := TUniQuery.Create(nil);
  vSQLCDS.Options.SetFieldsReadOnly := False;
  result := TClientDataSet.Create(nil);
  vTempResult := TClientDataSet.Create(nil);
  vProvide := TDataSetProvider.Create(vTempResult);
  try
    vSQLCDS.Connection := DMConn.SQLConn;
    vSQLCDS.SQL.Clear;
    vSQLCDS.SQL.Add(vSql);
    vSQLCDS.Open;
    vProvide.DataSet := vSQLCDS;
    vTempResult.SetProvider(vProvide);
    vTempResult.Open;
    result.Data := vTempResult.Data;
  finally
    FreeAndNil(vSQLCDS);
    FreeAndNil(vProvide);
    FreeAndNil(vTempResult);
  end;

end;

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: FiledValue is set to '0' when assigning Uniquery result to Clientdataset

Post by MaximG » Mon 10 Jul 2017 12:40

Unfortunately, we could not reproduce the problem according to your description. Please compose and send us via the e-support form ( https://www.devart.com the "Support"\"Request Support" menu) a small complete sample, in which the problem occurs. In addition, we will need DDL script to create DB objects, used in this sample

Post Reply