Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

AW: Default for date fields ?????: msg#00214

db.maxdb

Subject: AW: Default for date fields ?????

A.Beermann@xxxxxxxxxxxxxx wrote:
>
> Hello everbody
>
> In our application we show the results of an sql-select in a grid let
> let the users alter the data.
> Our users do not like. NULL. values in there application, so we define
> all tables like the following example
>
> l_sqltabneu = "create table YXZ ("+;
> "testid char(8) KEY," +;
> "testfield char(20) ASCII NOT NULL DEFAULT ' '," +;
> "testnumber FIXED(10,2) NOT NULL DEFAULT 0.00 " +;
> ")"
>
> Is it possible to define a date or datetime field with not null
default
> ' ' or '00-00-0000' ??????
> I always receive an error (invalid date format)
>

You can define a default for datatype DATE
mydate DATE DEFAULT DATE --> current date
mydate DATE DEFAULT '..........' the given date. In this case the
current date_and_time_format has to be taken into account:
http://dev.mysql.com/doc/maxdb/en/48/0d8018b4f211d2a97100a0c9449261/fram
eset.htm

Depending on the client used for specifiying this sentence is important:
The ISO date and time format is used by ODBC and JDBC applications and
cannot be replaced by a different date and time format.

As SQLStudio is an ODBC/JDBC client, you have to use the ISO
date-format.

And only real dates are allowed, starting from 1. Januar of the year 01,
month not greater than 12, day not greater then 31/30/29/28 -->
'0001-01-01' would be a good idea.

Elke
SAP Labs Berlin

> Any help welcomed
>
> Albert
>
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
http://lists.mysql.com/maxdb?unsub=elke.zabach@xxxxxxx


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/maxdb?unsub=gcdm-maxdb@xxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo