Oracle insert query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rubinamunir
    New Member
    • Sep 2006
    • 8

    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.
  • vssp
    Contributor
    • Jul 2006
    • 268

    #2
    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

    Comment

    Working...