Re: Insert default Date
TIMESTAMP does what you want, but if you for any reason wish to update records (mass updates) at the mysql> prompt without updating the TIMESTAMP, you'd be out of luck. For databases where I know that mass updates to data files will be required, and I want to preserve the user's LAST_MODIFIED (TIMESTAMP) field, I use DATETIME field type rather than TIMESTAMP. -Jim Victoria Reznichenko wrote: > Arthur, > Tuesday, October 15, 2002, 2:56:13 PM, you wrote: > > A> In access Now() as table field default sets the field when a new > A> record is created. In SQL Server there is getdate() & suser_sname() > > You can't use the return value of a function as a default value. > > A> Is there an equivalent for MySQL? > > Take a look at TIMESTAMP column type: > http://www.mysql.com/doc/en/DATETIME.html > > -- > For technical support contracts, goto https://order.mysql.com/?ref=ma02-010c > This email is sponsored by Ensita.net http://www.ensita.net/ >__ ___ ___ __ > / |/ /_ __/ __/ __ \/ /Victoria Reznichenko > / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] > /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ><___/ www.mysql.com > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Insert default Date
You can use TIMESTAMP field for this. It's automatically assigned current date if you don't insert anything in this field type or insert null. -Original Message- From: Arthur [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 7:56 AM To: MYSQL Subject: Insert default Date Hello MYSQL, In access Now() as table field default sets the field when a new record is created. In SQL Server there is getdate() & suser_sname() Is there an equivalent for MySQL? -- Best regards, Arthur mailto:[EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Attention: Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: Insert default Date
Arthur, Tuesday, October 15, 2002, 2:56:13 PM, you wrote: A> In access Now() as table field default sets the field when a new A> record is created. In SQL Server there is getdate() & suser_sname() You can't use the return value of a function as a default value. A> Is there an equivalent for MySQL? Take a look at TIMESTAMP column type: http://www.mysql.com/doc/en/DATETIME.html -- For technical support contracts, goto https://order.mysql.com/?ref=ma02-010c This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Insert default Date
In Mysql (http://www.mysql.com/doc/en/Date_and_time_functions.html) funnily enough: NOW() orSYSDATE() will return what you want. Regards M -Original Message- From: Arthur [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 12:56 To: MYSQL Subject: Insert default Date Hello MYSQL, In access Now() as table field default sets the field when a new record is created. In SQL Server there is getdate() & suser_sname() Is there an equivalent for MySQL? -- Best regards, Arthur mailto:[EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php