If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Trigger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-04, 13:28
exdter exdter is offline
Registered User
 
Join Date: Aug 2003
Posts: 328
Trigger

Is there some way I can make a trigger in MySQL? I want to put a default date in a date field, and can't figure out how to do it. Thanks.
Reply With Quote
  #2 (permalink)  
Old 05-27-04, 13:31
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
I don't think you can use triggers in MySQL unless it is in version 5.

But you are only asking to set a default date, can't you set up your table to accept that?

Code:
ALTER table mytable 
change mydate
mydate date default '0000-00-00'
Reply With Quote
  #3 (permalink)  
Old 05-27-04, 13:37
exdter exdter is offline
Registered User
 
Join Date: Aug 2003
Posts: 328
Thanks for your reply. I just get zeros in my date column now.
Reply With Quote
  #4 (permalink)  
Old 05-27-04, 21:24
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
well yes, that would be the default. What date do you want to set to? Use that in place of the 0000-00-00
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On