How to insert the date with timestamp in the table values

Jin
I have a table

create the table abc1 (dob date);

insert into abc1 values (to_date (sysdate, "HH24:MI:SS RRRR/MM/DD))

but when I see in the database, it shows that the normal date without time stamp.

Is it possible to insert in the back-end with time stamp.

Thank you...

Firstly, SYSDATE is a DATE already, no need to convert a DATE using the TO_DATE() function.

The date ALWAYS was a component "hour", if it is displayed until your NLS settings. for example:

SQL> CREATE TABLE ABC1(DOB DATE);

Table created.

SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY';

Session altered.

SQL> INSERT INTO ABC1 VALUES(SYSDATE);

1 row created.

SQL> SELECT * FROM ABC1;

DOB
----------
02/04/2010

SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY HH24:MI:SS';

Session altered.

SQL> SELECT * FROM ABC1;

DOB
-------------------
02/04/2010 12:54:57

SQL> DROP TABLE ABC1;

Table dropped.

Tags: Database

Similar Questions

  • How to insert the table of contents within a table

    Using FrameMaker 12, I create a table of contents within a table. This means, 1st column contains the number of paragraphs, the 2nd column of the text of the paragraphs, the 3rd column the page numbers. Of course, each item must fill each cell of the table. I downloaded an example.

    Thank you for your help

    Nicolas

    TOC special format.jpg

    Create a table of contents in normal conditions and use tabs as separators between the page number and section number, <$paratext>.

    Then use convert FM to the usefulness of the table to convert the table of contents for a table using the table design appropriate to your catalog.

    It's a manual, and you will have to redo this each time that you update the table, but it should only take a few clicks to do. Automate the steps with a script would make it less painful.

  • How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    Hello

    So I guess you have some files in ASM, see your first existing file structure

    Select file_name

    from dba_data_files;

    and to add to an existing table, the example below (even if you're better sticking with OMFs!)-is that what you are looking for?

    SQL > create tablespace TEST1

    2 datafile '+ DATA' size 1 M;

    Created tablespace.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    6 selected lines.

    SQL > alter tablespace TEST1

    2 Add datafile ' + DATA / mynewfile01.dbf ' size 2 m;

    Tablespace altered.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    + DATA / mynewfile01.dbf

    Thank you

  • How to set the default value of the attribute with a sequence number? Is it possible to add a string to seq.no. like abc0001?

    Mr President.

    How to set the default value of the attribute with a sequence number? Is it possible to add a string to seq.no. like abc0001?

    Concerning

    For the date, you can use groovy expression adf.currentDate to set the current date. reference http://adfgouravtkiet.blogspot.in/2012/11/how-to-set-default-values-for-entity.html

    You already have ways to use the sequence.

    How do you add a new value in the form. You're creating a new line of your page (user interface) and by engaging with validation operation? Unless you commit you will not be able to see anything in the table.

    Thank you

  • How to create dummy data with 1 TB

    Hi Expert,

    May I know how to create dummy data with 1 TB to test performance. ?

    Respect of

    Liang

    what columns you want to include? Basically, you can generate as many lines as you like to connect by queries - something like:

    create the table big_t

    as

    with

    generator1 like)

    Select rownum id

    of the double

    connect by level<=>

    )

    ,

    generator2 as)

    Select lpad ('* ', 1000,' *') col1

    of the double

    connect by level<=>

    )

    Select g1.id

    g2.col1

    of generator1 g1

    generator2 g2

    ;

    Of course, it is not 1 TB, but you can change the number of levels. Who said: I think you need to find a sensitive table first structure.

  • HOW to: Insert the symbol of the degree in text

    An another "How To" question.

    Running PE 13.1 on a Windows PC with WIN 7 64-bit.

    How to insert the symbol of the degree in text - I would like to have something like "temperature + 2 < degree symbol > water C.

    where < degree symbol > is the small circle (triggered).

    I found how to insert copyright (Alt + 0169) & the Tilde (Alt + 126) helped by Wikipedia, but the Windos ciode for the degree symbol is not shown - just the

    Unicode U + 2103 but Alt + 2103 just inserts a '7'.

    HEM

    HEM

    If you have the copyright © symbol to work for you with Alt + 0169, I think Alt + 0176, you should get the degree symbol as in 32 °.

    If please give it a try in the Titler, open Premiere Elements and let us know if it worked for you.

    Thank you.

    RTA

  • How to compare the new values with the old values in triggers.

    Dear all,

    Please tell me how to compare the new values with the old values in triggers.

    Hi, the employee example is in the document. You'd better read yourself.

    CREATE OR REPLACE TRIGGER Print_salary_changes
      BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
      FOR EACH ROW
    WHEN (new.Empno > 0)
    DECLARE
        sal_diff number;
    BEGIN
        sal_diff  := :new.sal  - :old.sal;
        dbms_output.put('Old salary: ' || :old.sal);
        dbms_output.put('  New salary: ' || :new.sal);
        dbms_output.put_line('  Difference ' || sal_diff);
    END;
    /
    
  • How to validate a date with time

    Hi all

    How can I validate date with time?

    Here is my code:

    var tempDate:Date = new Date();

    If (tempDate < 18 September 2012 07:30 ') {}

    doSomething

    }

    Thanks in advance

    A cleaner way is the dateCompare method:

    If (ObjectUtil.dateCompare (date1, date2) > 0) {}

    Date1 > date2

    } else ObjectUtil.dateCompare (date1, date2)<0)>

    date2 > date1

    } else {}

    date2 is date1

    }

  • kindly tell how to use the unique value of a table with the index 0

    kindly tell how to use the unique value of a table with the index 0

    Hi
     
    Yep, use Index Array as Gerd says. Also, using the context help ( + h) and looking through the array palette will help you get an understanding of what each VI does.
     
    This is fundamental LabVIEW stuff, perhaps you'd be better spending some time going through the basics.
     
    -CC
  • How to retrieve the actual value of this utl_raw.cast_to_raw () function

    I created a table like...

    create table mytable (name of user varchar2 (100));

    and added a column as...

    ALTER table mytable add raw (16) password.

    After that I'm inserting a value using below function,

    insert into mytable (username, password) values (: UN, utl_raw.cast_to_raw (:pwd)))

    United Nations-> abc
    pwd-> abc
    now, I want to display the data in the table,
    Select * from myTable. It is showing like this
    username password
    ABC 616263

    I want to see the real value of the password-> abc
    How to recover the actual value...
    Any help to solve the problem

    Published by: Guy on March 21, 2012 23:25

    On my 11.2.0.1 test the db instance:

    scott@ORCL> create table mytable(username varchar2(100));
    
    Table created.
    
    scott@ORCL> alter table mytable add password raw(16);
    
    Table altered.
    
    scott@ORCL> var un varchar2(10);
    scott@ORCL> var pwd varchar2(10);
    scott@ORCL> exec :un:='test';
    
    PL/SQL procedure successfully completed.
    
    scott@ORCL> exec :pwd:='testpw';
    
    PL/SQL procedure successfully completed.
    
    scott@ORCL> insert into mytable (username, password) values (:un , utl_raw.cast_to_raw(:pwd));
    
    1 row created.
    
    scott@ORCL> select * from mytable;
    
    USERNAME                                                                                             PASSWORD
    ---------------------------------------------------------------------------------------------------- -------------------------
    test                                                                                                 746573747077
    
    1 row selected.
    
    scott@ORCL> column pw for a15;
    scott@ORCL> select username,utl_raw.cast_to_varchar2(password) pw from mytable;
    
    USERNAME                                                                                             PW
    ---------------------------------------------------------------------------------------------------- ---------------
    test                                                                                                 testpw
    
    1 row selected.
    

    Concerning
    Girish Sharma

  • How to get the updated values of the loops while they are running

    Hello

    I am trouble with a very basic problem, how to access the updated values of the "loop FOR" during operation?  Basically, the VI I is currently working on two sub vis calls each sub VI has a loop for, and the two screws may or may not work for the same number of iterations. My goal is to read the values in each terminal within the loop of two sub VIs, in primary VI. I tried to do this using Global Variables, but in main VI it will display only the last iteration of the two value sub live. Could someone please tell me whrere I go wrong? Is there any other/better way to do this.

    I appreciate any input on this issue.  

    Pass a reference of the main VI control to the Sub screws.  See attached example.

  • How to set the initial value programmatically in af:selectOneChoice

    Hi all

    How to set the initial value programmatically in af:selectOneChoice

    filled with view object instance, but I want to show the value initial programmactically

    This can help you: Re: how to set the default value of the component selectOneChoice in ADF

    and the default af:selectOneChoice programmatically from backing bean

  • How to remove the decimal value (. 00) of the slider control

    Please ask me how to remove the decimal value (. 00) of the slider control and Add (if possible) % in after effects cs6.

    I guess you mean to animate text with a slider.

    Add a slider (options for expressions) to your text layer and then add this expression in your Source text:

    x = Math.Floor (effect ("Slider Control") ("Slider"));

    x+" %"

    That's all

  • How to design the table from the answer to the question table.

    Hi all

    I am creating an application for student review online.

    There are two types of questions, the only choice of response and multi choice answers.

    My question is less than
    create table question_master
    (
    exam_id number references exam_master(exam_id),
    marks_of_each_question number,
    type_of_question char(1),-- single choice answer/multiple choices answer
    q1 varchar2(2000),
    q2 varchar2(2000),
    q3 varchar2(2000),
    q4 varchar2(2000))
    my table to answer (I'm not satisfied with who is below
    create table answers_of_questions
    (
    answer_id number primary key,
    question_ID number referenes question_master(question_id),
    answer varchar2(4000) not null,
    is_answer_correct char(1),--y/n,
    student_selection char(1),--y/n   student select it or not
    ....
    ...
    now, I'm perfectly how to create the RESPONSE table to contain the answers.
    the only choice is good, but several checkboxes choices, what to do?
    How to design the table from the answer?

    do I have to create 2 tables to contain the answers?
    Note: the QUESTIONS and ANSWERS, all will be entered by the teacher. students will make a choice and I will store this choice in another table
    may be called STUDENT_SELECTED_ANSWERS or something like that.
    If anyone has some reference to the script retail scheme review online, kindly share with me.

    Kind regards.

    Kind regards.

    If you need to have answers in another table:

    Student (student_id, name, etc...)
    Review (exam_id, exam_name, etc...)
    Question (question_id, exam_id, question_text)

    Response (question_id, a_text, b_text, c_text, d_text, a, b, c, d).<-- one-to-one="" with="" question="" table,="" a-d="" flags="" used="" to="" indicate="">
    OR
    Response (question_id, answer_id, answer_text, OK)<-- many-to-one="" with="" question="" table,="" correct="" flag="" used="" to="" indicate="" correctness="" for="" this="" single="">

    Student_Answer (student_id, question_id, a, b, c and d)
    OR
    Student_Answer (question_id, student_id, answer_id)<-- creation="" of="" a="" question_id+answer_id="" in="" this="" table="" implies="" the="" student="" checked/selected="" it="" as="" an="">

    To what extent you want to standardize, it is up to you.

  • How to use the prompt value in the column of the report

    Hello

    I have a quick report column which is 'Adj Type' that contains values 10,20,30, and when the user selects Adj Type = 10, this value should be passed on to the column of the report.

    For example. Value in column 1 is 10 and this should multiple with the prompt value and production is expected to be 10 * 10.

    Ideas how to capture the prompt values in the column of the report for the calculation.

    Hi hsekar,

    (1) declare a presentation online in the section variable set Variable--> Variable--> P_var presentation

    (2) in Fx Table_name. Your_column * @{P_Var}

    @{P_var} {20} (20 is the default, it replaces when a user selects the value in the command prompt

    Thank you
    Saichand.v

  • How to set the initial value for a single radiobutton in a group of Radio buttons

    Hi all

    I have a radiogroup with 3 buttons. The names of the RadioGroup are driven out of a XXVO.

    3 Radion buttons:

    + 9
    * XX
    * XXX

    When loading the Page I want to make an XXX option button to be the default, please suggest how.

    Note: The radiobutton values come from VO

    Thank you

    Hello

    XXCONTACT_ADDR_BUTTON1 - is the value of the radio button to select the right...

    Very well.. :))

    Concerning
    Meher Irk

Maybe you are looking for