Board index » delphi » HELP DEFAULT VALUES

HELP DEFAULT VALUES

The thing is that I'm new to interbase and delphi IBX programming.

Any way I have 2 little questions

1- If I set DEFAULT VALUES to some table's fields,           Why I just can
get those values on my application untill     call the applyupdates and
refresh methods of the             ClientDataSet?
    ps. (I've allready set the autogenerate property of the
fields to arDefault)

2- The Generator some times work and some times don't     and then, the
server rises the error X Field Can't Be         Null

 

Re:HELP DEFAULT VALUES


Quote
mgumbs wrote:
> 1- If I set DEFAULT VALUES to some table's fields,           Why I
> just can get those values on my application untill     call the
> applyupdates and refresh methods of the             ClientDataSet?

        DEFAULTs only happen after the INSERT is complete (i.e., after you
call CDS.ApplyUpdates), and then only if the column containing the
DEFAULT is not included in the INSERT statement generated by the
TDatasetProvider.

        For hints on how to deal with generators in an n-tier application,
read this:

http://delphi.weblogs.com/stories/storyReader$195

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase Perf. Monitor : http://delphi.weblogs.com/IBPerformanceMonitor
InterBase PLANalyzer 1.1: http://delphi.weblogs.com/IBPLANalyzer

Other Threads