Question about DATE format (Q190 in TK) 1Z0-007
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Question about DATE format (Q190 in TK) 1Z0-007

  1. #1
    Join Date
    Nov 2006
    Posts
    21

    Question Question about DATE format (Q190 in TK) 1Z0-007

    Examine the structure of the EMPLOYEES table:

    EMPLOYEE_ID NUMBER Primary Key
    FIRST_NAME VARCHAR2(25)
    LAST_NAME VARCHAR2(25)
    HIRE_DATE DATE


    Which INSERT statement is valid?

    A)INSERT INTO employees (employee_id, first_name, last_name, hire_date)
    VALUES ( 1000, ‘John’, ‘Smith’, ‘01/01/01’);
    B)INSERT INTO employees(employee_id, first_name, last_name, hire_date)
    VALUES ( 1000, ‘John’, ‘Smith’, ’01 January 01’);
    C)INSERT INTO employees(employee_id, first_name, last_name, Hire_date)
    VALUES ( 1000, ‘John’, ‘Smith’, To_date(‘01/01/01’));
    D)INSERT INTO employees(employee_id, first_name, last_name, hire_date)
    VALUES ( 1000, ‘John’, ‘Smith’, 01-Jan-01);

    ANSWER: TK says A

    In my opinion the default repsetation of the date in Oracle is like this: '01-JAN-01' . But it doen't exist in the answers.

    I've tried A, but got the following error:

    ORA-01843: not a valid month

    any opinion?

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    My opinion is that's a horrible question dependant on the characterset you are using.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Nov 2006
    Posts
    21
    What do you mean? Do you mean that the default date format is somehow dependant on the character set (regional settings etc.)?

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    yes
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  5. #5
    Join Date
    Nov 2006
    Posts
    4
    You have to set the parameter NLS_DATE_FORMAT to use the date parameter. You can use

    show parameter nls_date_format this will show you the format that is in use.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width