Sounds to me like your code (or perhaps in an ancestor class) is doing
something unexpected. If the column is not included the the list of
updateable columns, then it will not be included as a column in the insert
list. I've never had a problem with PB in this respect. I suspect that
something else is occurring that is causing the behavior. You may want to
use the preview pane in the dw painter to insert a row (if possible); this
would at least identify PB or your code as the problem. The next step would
be to create a simple test case using the existing datawindow (and without
any of your ancestor/application code). If these succeed, then the problem
lies with the application code. Although I haven't moved beyond PB9 6533, I
suspect that application code or design is the problem. It also may be
related to some odd cirucumstances (sharedata, linkage, get/setfullstate,
etc.). You may also want to investigate whether some piece of code is
dynamically modifying the datawindow and (implicitly or explicitly) setting
the update properties.
Be aware that the default you define in the table and the default you define
within PB are different "things" entirely. PB will not automatically update
a default defined in the datawindow to be consistent with any table-level
default. This should not be an issue in this particular situation.
One last thing: The phrase "... syntax and erroring as the default of zero
is not being recognized" is not particularly meaningful. I will repeat.
Help is much likely to be more "helpful" and more forthcoming if you
accurately and completely describe the problem. By itself, a default (or
lack thereof) will not produce an error when a row is inserted into a table.
Perhaps there is a constraint or trigger that enforces the use of a specific
domain of values for a column, producing the error. It helps to know the
exact text of the error. I'm still not certain what "...the column default
is recognized." means but I'm not certain it matters at this point.
[quoted text, click to view] "roz" <roz@discussions.microsoft.com> wrote in message
news:D6DE6DA2-C749-4546-B121-D097E2C3A25F@microsoft.com...
> I am using PB 9.0.1 Build 7236. I am using a datawindow to do an Insert.
> The column in question should default to zero. It is NOT included as an
> updateable column in the datawindow. But PowerBuilder is including it in
the
> Insert syntax and erroring as the default of zero is not being recognized.
> When I use the PB Native MS SQL Server interface, the column default is
> recognized. In Enterprise Manager, the default of zero shows on the
> in-question column.
>
> I have asked in PB groups but have only got one reply that states that
this
> is the way the OLE DB interface has always worked. Is this a peculiarity
to
> OLE DB? Or do you think it is a PB problem?
>
>
> "Scott Morris" wrote:
>
> > You need to be much more specific. What does "not recognizing column
> > defaults" mean? What problems? Are you using datawindows. If so, the
only
> > time columns are included in insert statements is when your application
code
> > sets the value of that column. Is that what you are doing? If your
code
> > (and user) do not provide a value, then it is left out of the inserted
> > column "list". In this case, the default is used. You also failed to
> > specify which version of Powerbuilder. At the very least, you should
review
> > the fix list for the most current build of the version you are using to
> > determine if there is a bug that has already been fixed.
> >
> > Incidentally, you are more likely to get help posting in a powerbuilder
NG.
> > The more information you post, the more likely someone will help.
> >
> > "roz" <roz@discussions.microsoft.com> wrote in message
> > news:091BC8BE-02BE-41AE-8F5C-07621F96BFA5@microsoft.com...
> > > I am connecting through ole db from Powerbuilder to Ms Sql Server
2000.
> > > Powerbuilder is not recognizing the column defaults which leads to
> > problems,
> > > especially for inserts. Has anyone run into this and can you help me
out?
> >
> >
> >