Page 1 of 1

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

Posted: Wed 05 Jul 2017 09:28
by adityashirodkar
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;

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

Posted: Mon 10 Jul 2017 12:40
by MaximG
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