Results 1 to 3 of 3
Thread: Error in table creation
- 06-11-2011, 10:29 PM #1
Member
- Join Date
- May 2011
- Posts
- 56
- Rep Power
- 0
Error in table creation
I have trying to create a MySQL database table as:
But it shows me a error that :Java Code:CREATE TABLE `tolltaxsystem1.2`.`vehicle`( `vehicle_type` ENUM('LMV','LCV','BUS','TRUCK','MAV') NOT NULL , `vehicle_num` VARCHAR(12) NOT NULL , `journey` ENUM('SJ','CR','EX') NOT NULL , `exempted_type` VARCHAR(4) NOT NULL DEFAULT 'NA' , `material` ENUM('O','ME','MG','AG') NOT NULL DEFAULT 'O' , `amount` DOUBLE(5,2) NOT NULL DEFAULT '0.0' , `booth_num` ENUM('1','2','3','4','5','6','7','8','9') NOT NULL , `lane_num` TINYINT NOT NULL DEFAULT '0' , `passed_at` DATETIME NOT NULL DEFAULT NOW(), `image` BLOB )
Please guide me how to remove this error, as i want to store current date and time in the column with every new row insertion with NOW() function..........Java Code:Error Code : 1067 Invalid default value for 'passed_at'
- 06-11-2011, 11:04 PM #2
Have you read the MySQL documentation?
MySQL :: MySQL 5.6 Reference Manual :: 10.1.4 Data Type Default Values
db
- 06-11-2011, 11:25 PM #3
Member
- Join Date
- May 2011
- Posts
- 56
- Rep Power
- 0
Thanks very much..that things are sometimes difficult to explore on web..Have you read the MySQL documentation?
MySQL :: MySQL 5.6 Reference Manual :: 10.1.4 Data Type Default Values-.gif)
Do me one more favor please, if i want to create a trigger or anything like this that can reset my autoincrement values to zero again with the change in date?
How can i accomplish this?
Similar Threads
-
Java and minecraft server creation error
By Vaart in forum NetworkingReplies: 2Last Post: 06-09-2011, 05:24 PM -
"Access is denied" error while file creation
By Bharath_M in forum Advanced JavaReplies: 4Last Post: 04-10-2011, 12:23 PM -
Error in JFrame creation...help asap
By bluejamesbond in forum Advanced JavaReplies: 1Last Post: 01-30-2011, 02:30 AM -
PDF File creation Error
By siva_vs_siva in forum New To JavaReplies: 2Last Post: 12-24-2010, 12:42 AM -
Getting error with table packages..
By doha786 in forum New To JavaReplies: 2Last Post: 03-31-2010, 10:20 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks