Board index » delphi » Default value problem (Help me)

Default value problem (Help me)

Whay my filed not accept the default value when I insert the record?

This is the sql cod whith I create my field.

anexo varchar(1) default 'N"

Help me please..

 

Re:Default value problem (Help me)


Deosdete Pereira da Silva wrote:

Quote

> Whay my filed not accept the default value when I insert the record?

        Probably your client is setting it to something.  DEFAULTs only work
when the field in question is not mentioned at all in the INSERT SQL.

Quote
> This is the sql cod whith I create my field.

> anexo varchar(1) default 'N"

        Try this in ISQL:

INSERT INTO MYTABLE (
  /* list of fields -- do not include anexo! */
) VALUES (
  /* list of values */
);

        You should see the default has worked.

        HTH,

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Other Threads