468,278 Members | 1,562 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,278 developers. It's quick & easy.

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 3391
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
reply views Thread by NPC403 | last post: by
1 post views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.