Problems about fields with DataType ftOraClob

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
elraj71
Posts: 7
Joined: Wed 29 Jun 2011 12:31

Problems about fields with DataType ftOraClob

Post by elraj71 » Wed 10 Feb 2016 10:41

Hi!

I use UniDAC (vers. 6.2.10) in Delphi XE2 application to access data in Oracle 11.2 Database.

In my application, I read data by TUniQuery/TDatasetProvider/TClientDataset and I have problems about fields with DataType ftOraClob.


A sample code that I used is:

Code: Select all

procedure TForm1.Button14Click(Sender: TObject);
const
  cSql =
  'SELECT * FROM PLNOTE ' +
    'WHERE IDDIP = :IDDIP AND DATA = :GIORNO ';
var
  qry: TUniQuery;
  dsp: TDatasetProvider;
  cds: TClientDataset;
begin
  qry := TUniQuery.Create(nil);
  dsp := TDataSetProvider.Create(nil);
  cds := TClientDataSet.Create(nil);
  try
    qry.Connection := SqlConnOracle;
    qry.Options.SetFieldsReadOnly := False;
    //
    dsp.DataSet := qry;
    dsp.Name := 'DSPPRESENZE';
    cds.SetProvider(Dsp);

    qry.sql.Text := cSql;
    Cds.FetchParams;
    Cds.Params.ParamByName('IDDIP').AsInteger := 1117;
    Cds.Params.ParamByName('GIORNO').AsDateTime := EncodeDate(2014, 3, 14);
    Cds.Open;
    //
    Cds.Edit;
    Cds.FieldByName('NOTE').AsString := 'mia nota'; // <------- doesn't work!!!
    Cds.Post;
    Cds.ApplyUpdates(0);
  finally
    cds.Free;
    dsp.Free;
    qry.Free;
  end;
end;
"NOTE" is a CLOB field. The problem is that Edit doesn't work. After Edit, Post, ApplyUpdates I found a Null value in field "NOTE".

why? Can I solve this problem?

Thanks in advance,
Federica

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Problems about fields with DataType ftOraClob

Post by AlexP » Wed 10 Feb 2016 11:35

Hello,

To solve the issue, you should set the DataSetProvider1.ResolveToDataSet property to True.

elraj71
Posts: 7
Joined: Wed 29 Jun 2011 12:31

Re: Problems about fields with DataType ftOraClob

Post by elraj71 » Thu 11 Feb 2016 09:08

AlexP wrote:Hello,

To solve the issue, you should set the DataSetProvider1.ResolveToDataSet property to True.
This solution solves my issue: thank you!!

Federica

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Problems about fields with DataType ftOraClob

Post by AlexP » Thu 11 Feb 2016 09:41

Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.

Post Reply