473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Inserting values into a table with two timestamp fields

how to insert values in this table for these two timestamps???
Expand|Select|Wrap|Line Numbers
  1. create table s_details(
  2.     SELECT_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  3.     TITLE    varchar(4) NOT NULL,        
  4.     FIRST_NAME    varchar(20) NOT NULL,
  5.     MIDDLE_NAME    varchar(20),
  6.     LAST_NAME    varchar(20) NOT NULL,
  7.     DATE_OF_BIRTH    date NOT NULL,
  8.     NATIONALITY    varchar(20) ,
  9.     E_MAIL        varchar(30) NOT NULL,
  10.     DATE_OF_ENTRY_OF_DETAILS TIMESTAMP DEFAULT 0,
  11.     MODIFIED_DATE timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  12.     );
Sep 19 '07 #1
4 2588
pbmods
5,821 Expert 4TB
Heya, Praveena. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=MySQL]
MySQL code goes here.
[/CODE]

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

Are you asking how to issue an INSERT query?
Sep 19 '07 #2
yeah,how to insert values for this table?
jus gimme an example to insert values..
Sep 19 '07 #3
pbmods
5,821 Expert 4TB
Heya, Praveena.

Well, I'd guess it would work something like this:
Expand|Select|Wrap|Line Numbers
  1. INSERT
  2.     INTO
  3.         `s_details`
  4.         (
  5.             `TITLE`,
  6.             `FIRST_NAME`,
  7.             `MIDDLE_NAME`,
  8.             `LAST_NAME`,
  9.             `DATE_OF_BIRTH`,
  10.             `NATIONALITY`,
  11.             `E_MAIL`,
  12.             `DATE_OF_ENTRY_OF_DETAILS`
  13.         )
  14.     VALUES
  15.         (
  16.             'title',
  17.             'first name',
  18.             'middle name',
  19.             'last name'
  20.             'date of birth',
  21.             'nationality',
  22.             'email',
  23.             CURRENT_TIMESTAMP
  24.         )
  25.  
You don't need to specify a value for the `SELECT_ID` and `MODIFIED_DATE` fields; they will be automatically set for you.
Sep 19 '07 #4
thanx..
it helped me alot..
Sep 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and...
6
by: My Deja | last post by:
what is the syntax for specifying the default values for timestamps in MySQL in the CREATE TABLE command? I have 2 timestamps, one for when the record was entered, the other for any subsequent...
4
by: Greg Ofiesh | last post by:
Anyone who can help, I have two tables T1 and T2. T1 has fields K1 and F2 and T2 has fields K2 and F1. F1 is the foreign key relating to K1 and F2 is the foreign key relating to K2. My...
15
by: Jaraba | last post by:
I am working in a project that I need to parse an arrayt an select records based upon the values parsed. I used the functions developed by Knut Stolze in his article 'Parsing Strings'. I am...
9
by: Mohd Al Junaibi | last post by:
Hello all, my first post here...hope it goes well. I'm currently working on stored procedure where I translated some reporting language into T-SQL The logic: I have a group of tables...
7
by: ebindia0041 | last post by:
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, Asp.net 1.1 with c# I'm inserting simple records into a table. But one...
4
priyan
by: priyan | last post by:
hai everyone, I am having a doubt in inserting data in time field. I am having a table in which in column in timestamp without time zone datatype. I want to insert a row into the table but...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.