471,046 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Oracle insert query

Hi.
i need help in insert query . i am working in php and oracle there i need insert datetime.i don't know the format please tell me how can i insert date with time in oracle and wht must be data type date,timestamp.
Oct 30 '06 #1
1 3467
vssp
268 100+
here is the sample query
If it does then this should work for you:
INSERT INTO MAIN
(
ID,
NAME,
FAMILY,
SUBJECT,
MESSAGE,
MAINDATE,
SUBJECTID,
MSGTIME)
VALUES
(select id_seq.nextval,
'Test', 'Testdata', 'Testmessage', 'Hello Testing',
to_char(sysdate, 'mm/dd/yy'),
id_seq.currval,
to_char(sysdate, 'hh:mi a.m.')
);

vssp
Oct 30 '06 #2

Post your reply

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

Similar topics

4 posts views Thread by francis70 | last post: by
reply views Thread by Kiyoung Yang | last post: by
reply views Thread by George | last post: by
4 posts views Thread by sajid | last post: by
11 posts views Thread by Markus Breuer | last post: by
2 posts views Thread by Asfand Yar Qazi | last post: by
11 posts views Thread by Chris Fink | last post: by

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.