Options.RequiredFields and TClientDataSet

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zarko
Posts: 13
Joined: Fri 29 Feb 2008 12:13

Options.RequiredFields and TClientDataSet

Post by zarko » Mon 07 Apr 2008 13:01

Hi,

Can someone (crlab) confirm the next situation:

1. TORAStoredProc connected to a stored proc returning a cursor (dataset)
2. TClientDataSet grabs the dataset over TDataSetProvider.
3. A persistent set of fields is created on the client dataset level.
4. All fields are manually marked as "Required = false"

Upon "Post" a DBClient error "Field value is required" is thrown.

Now, all the fields are marked as non required - yet Delphi throws the exception.

Now, after 3 days of reading about TClientDataSet and TDataSetProvider I've figured out that the "problem" is inside the TORAStoredProc.

Option.RequiredFields is TRUE by default.

Since I'm editing my client dataset and will send changes back to the database using a series of insert/update statements .. I do not need this "Options.RequiredFields" to be set to true by default.

Am I right in presuming that "Options.RequiredFields =default= true" is my problem?

I have tons of TORAStoredProc controls where this should be set to "false".

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 08 Apr 2008 07:54

Yes, the error occurs because Required property of the fields in the TOraStoredProc component is set to True.

zarko
Posts: 13
Joined: Fri 29 Feb 2008 12:13

Post by zarko » Tue 08 Apr 2008 08:26

Plash wrote:Yes, the error occurs because Required property of the fields in the TOraStoredProc component is set to True.
Yes, but I'm trying to update my client dataset where all the persistent fields are set Required = false.

In what way is (why) this RequiredFields Option related to my client dataset?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 09 Apr 2008 06:46

When RequiredFields option is set to True, the TOraStroredProc component creates fields with Required property set to True.

The provider checks that a field in the TOraStroredProc component is required, and raises the error.

zarko
Posts: 13
Joined: Fri 29 Feb 2008 12:13

Post by zarko » Wed 09 Apr 2008 07:35

Plash wrote:When RequiredFields option is set to True, the The provider checks that a field in the TOraStroredProc component is required, and raises the error.
Pardon my ignorance, by why does the provider check my client dataset? I'm not applying updates back to the dataset using provider.

I just want to post a new record in my client dataset (memory) - not "currently" related to the stored procedure.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 10 Apr 2008 07:19

This error is raised inside DSCursor COM object. We don't have sources of this class, and we don't have an information why Required property of TOraStoredProc component's fields is checked.

Post Reply