Al Omar
Al Omar

Reputation: 21

Stored Procedure (INSERT INTO w/ Timestamp

Hi have my tbl_student containing

StudentID(Varchar), Lastname(Varchar), Firstname(Varchar),
Middlename(Varchar), Gender(Varchar), DateOfBirth(Date),
Address(Longtext), PhoneNumber(Varchar), Email(Varchar),
Modified(Timestamp)

I'm trying to create a Stored Procedure which is INSERT INTO the table. I can create the procedure WITHOUT the timestamp. Can somebody help me how to QUERY a Stored Procedure with timestamp in it. Thanks i tried this Code but it doesn't work

INSERT INTO tbl_student VALUES (studid, ln, fn, mn, gendr, bday, addrs, cntct, eemail, modi)`

Can anyone help me? thanks

Upvotes: 1

Views: 6298

Answers (1)

Darshan Mehta
Darshan Mehta

Reputation: 30839

Assuming it's Mysql and the column type is Timestamp, we can use MySql's CURRENT_TIMESTAMP() in the insert query to set the field value, e.g.:

INSERT INTO TBL_STUDENTS (studid, modified_time..) values (1,CURRENT_TIMESTAMP())

Upvotes: 2

Related Questions