How to extract the second sysdate value using the EXTRACT function

Hello

I want to extract the second sysdate value using the EXTRACT function.
When I run the following query I get an error;

SELECT extract (second OF SYSDATE) FROM dual;

ORA-30076: field of invalid extract for the source of the extract.

When I do to extract the month I get the correct result.

Is there some necessary formatting by specifying the sysdate (or any other date value) in the query. ?


Thank you.

You can extract only the year/month / day, day

SQL> Select extract(year from sysdate) from dual;

EXTRACT(YEARFROMSYSDATE)
------------------------
                    2008

SQL> Select extract(day from sysdate) from dual;

EXTRACT(DAYFROMSYSDATE)
-----------------------
                     20

SQL> Select extract(month from sysdate) from dual;

EXTRACT(MONTHFROMSYSDATE)
-------------------------
                       11

IF you enter Minute or Seconds

SQL>  Select extract(minute from sysdate) from dual;
 Select extract(minute from sysdate) from dual
                            *
ERROR at line 1:
ORA-30076: invalid extract field for extract source
but with timestamp you can get the seconds

SQL> select EXTRACT(second FROM current_timestamp) from dual;

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                              39.473

SQL> select EXTRACT(second FROM current_timestamp) from dual;

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                              57.474

SQL> /

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                              59.787

SQL> /

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                                .412

SQL> /

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                                 .99

SQL> /

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                               1.458

SQL> /

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                               1.896

SQL> /

EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
------------------------------------
                               2.334

Edited by: Viswarayar Maran on November 20, 2008 14:30

Tags: Database

Similar Questions

  • How to associate the key function on thinkpad T61p

    How to associate the key function on thinkpad__Fn Key__Hibernate mapping of keys for Lenovo Thinkpads

    How to map the keys "Fn F4" on my Thinkpad T61p to keyboard MS Wireless Comfort Keyboard 5000 to Hibernate?

    Your Thinkpad keyboard doesn't have access to the MS Wireless Comfort Keyboard 5000 drivers, firmware and add the functioon of Microsoft for the Thinkpad (and vice versa).

    Here is an article on how to remap the keys in Vista (with a link to a program that will help): http://www.howtogeek.com/howto/windows-vista/map-any-key-to-any-key-on-windows-xp-vista/. I don't know if this works with the function keys, but it's worth a try.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to call the java function with javascript setting in mobile adf?

    How to call the java function with javascript setting in mobile adf?

    The ADF Mobile utility container API can be used from JavaScript or Java.

    Application container API - 11 g Release 2 (11.1.2.4.0)

  • How to activate the Sleep function to put the computer to sleep if a program is open?

    I have Windows Vista basic on a desktop Dell 530.  I found that if I have a program or application running (such as I-tunes or windows media player) then the Sleep function will not put the computer to sleep.  How to activate the Sleep function to replace these programs and put the computer to sleep?

    Note: This is how it was with windows XP, the Sleep function would put the computer to sleep no matter what was running, he was reliable, if you left the computer and I forgot that you had something running.

    Thanks for your help.

    Hi kevino4130,

    If you disable sharing on your computer (not only the power settings) of media, it should allow him to enter the mode 'sleep'.

    See if that does not solve your problem and let us know.

    Dave D

    Dave D
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to access the dehaze function in Photoshop?

    How to access the dehaze function in Photoshop CC? This is supposed to be present in the new versions of Lightroom and Photoshop. I see it in Lightroom, but it cannot fine in Photoshop. Thank you.

    It is in camera raw.

  • How to activate the search function.  I get no match found when I search for words on the scanned PDF document

    How to activate the search function.  I get no match found when I search for words on the scanned PDF document

    A scanned document is just an image; even if it contains text, it is not searchable.

    Put text in a scanned image available, you will need to perform the recognition of text (OCR), which can be made with Acrobat, but not the free player.

  • How to call the javascript function in ADF

    I have the javascript function stored in a .js file external (try to reuse in another application). How can call the javascript function for an event of ADF faces component. I need to I am a newbie to ADF, all ideas are appreciated.

    Kind regards
    Surya

    Published by: sgodavar on Sep 24, 2010 11:44

    Include JavaScript to the jsff/jspx as page:

    Call it like:

    Type = "dblClick" / >
    Amit

  • How to create the constructor function for a pl/sql table?

    I created a PL/SQL type as table below:

    create or replace type typ_tbl_des_text is table of the typ_tof_des_text

    OK so far, but I would like to have a constructor function which would be subject to validations and raise_application_error when a validation condition is not met.

    How to do this?

    The typ_tof_des_text that I created with a constructor function, so that the record-level validation are performed in the constructor. And I think the postings between several records shall be made in a constructor for typ_tbl_des_tex, but cannot figure out how to create such a constructor.

    BEDE wrote:

    So, if I have understood correctly, to a plsql table type, I can't have a member procedure. Or can I? I mean, just as for a type of failure I can have one or more constructors and possibly several procedures of Member.

    For the standard tables in PL/SQL, you will need to create your own API (using procedures and functions) to handle beyond the basics provided by the language. No constructors and methods as it is no o - o.

    After thinking a little deeper, I reformulate what I said earlier and actually wants to have a member procedure called add_item, who would be first to check if an item with a key value exists and, if so, it would be up-to-date and so not only extend the plsql table.

    Two options.

    As we already mentioned, an associative array can be considered - note however that this structure of table has name-value pairs.

    Another method is to use a TWG (global temporary table). You define the structure of the once initial table. When a session uses the structure of the table, private copying is instantiated for this session. When the session ends, this copy is destroyed. The table is a temporary structure for this session only.

    It can include indexes and so on – which means you can use the constraints of primary keys, unique indexes, secondary indexes and so on.

    TWG scales are much better than collections or arrays that require a PGA (expensive private server) memory. In addition, SQL can be used natively against a GTT - unlike the arrays and collections.

  • ALPS pointing device - how to restore the scroll function

    Until a few days before, my mousepad has allowed me to scroll. I tried looking at the settings in the control panel / mouse, but the options have disappeared.

    Is this a driver problem? If so, should which driver I download and where from?

    The current driver is:
    V5.3.203.18
    and was created 17/07/2003

    If it's not a driver problem, anyone have any suggestions on how to restore the scrolling feature?

    Thanks a lot :)

    I put t really understand what the problem is here. As far as I know, the mouse settings cannot disappear so easy. In any case try to roll back OS to an earlier time using System Restore tool. Maybe this option will be there again.

  • HP ENVY 4520: Need info - how to run the Scan function on desire 4520

    My printer is installed and working, I use only the aspect of the printer and do not know how to operate the scanner /copier. Where can I find downloadable instructions? I looked at the HP site, see nothing that helps me. Thanks for your help.

    Everything on the site of HP support for your printer.

    http://support.HP.com/us-en/product/HP-envy-4520-all-in-one-printer-series/5447920/model/5447921/manuals

    Download and read the User Guide.  Click on "how to"...

  • How to set the mod function in TestStand

    I have trouble using the mod function in a seq TestStand to terms if condition. There is an unexpected token syntax error: MOD.

    I would advice how to do this correctly. Thank you!

    There are 100-1000 MOD

  • Windows Media Player - how to set the repeat function?

    I set a schedule to play music using Windows Media Player, if I set the repeat function, then it will play the file audio repeatly, but first I would annex plays a sound at a specific time only once without repeat and play another his repeatly at another time, someone has suggestions on how to set this option on the calendar?

    Thanks in advance for your suggestions

    Hello

    What version of Windows Media Player you have installed?

    Try to create individual selections with each audio file. Later, try using the repeat function.

    If you use Windows Media Player 11, you can follow this link.

    Shuffle and repeat items in Windows Media Player


    Reference:
    How to schedule tasks in Windows XP

    Hope the helps of information.

    Please post back and we do know.

  • How to fix the search function in Windows 7

    I just bought a new HP laptop with Windows 7 64 bit and am ready to throw it out the window.  The search function is the worst.  He is unable to find files containing search terms - only discovered the files whose file NAMES containing the search terms.  It does not define the search parameters as did Windows XP.  How can I keep/use the search function of Windows XP?  Y at - it a patch?  A fix?  An add-on software that I can use?  Microsoft warns that if you try to uninstall Windows 7 and try to install Windows XP, your computer may become "unusable".  Search results are inaccurate - I use it for work and I can't have a search function that does not work as XP did or get wrong results!  I've already indexed all of the computer and 2 sessions of chat with people from HP support.  Nada. I don't have to become a geek simply search my files.

    Hi Sylvia,.

    Please try management than fix the following:

    http://support.Microsoft.com/mats/windows_search/en-us

    Also, what antivirus do you use? We can't wait to hear back on your part.

  • How to study the commands/functions for example <>? &lt;? Sum (fieldName)? &gt;

    I'm new to bi publisher and in some cases, it seems that people are coding for what they want.  How can I find more information about the possible functions that are available.

    For example: Sum.  I used it and it works.  I just what to know whatelse is available and how to code. <? sum (#)? >

    Howard

    Please take a look at this material. It covers almost most of the features of BI Publisher.

    http://docs.Oracle.com/CD/E28280_01/bi.1111/e22254.PDF

    Go through the sub topics to know more functions RTF on

    Extended function in RTF templates support

    Creation of RTF models

    Creating RTF templates using the template for Word generator

  • How to share the same function in different frames

    I create a quiz of multiple choice with several questions.

    I have every clickable selection using "answer1", "answer2"... as the instance name.

    I created a standard button to show the different States and make selection (like what is below):

    ANSWER1.buttonMode = true; / / to display the hand icon

    ANSWER1.addEventListener (MouseEvent.CLICK, answer1Click);

    ANSWER1.addEventListener (MouseEvent.ROLL_OVER, answer1Rollover);

    ANSWER1.addEventListener (MouseEvent.ROLL_OUT, answer1Rollout);

    function answer1Click(ev:MouseEvent):void

    {

    ANSWER1.gotoanswerndStop (2);

    ANSWER2.gotoanswerndStop (1);

    answer3.gotoanswerndStop (1);

    answer4.gotoanswerndStop (1);

    salt = 1;

    }

    function answer1Rollover(ev:MouseEvent):void

    {

    ANSWER1.gotoanswerndStop (2);

    }

    function answer1Rollout(ev:MouseEvent):void

    {

    If (salt! = 1).

    {

    ANSWER1.gotoanswerndStop (1);

    }

    }

    Duplicate the setting for different questions, but I can't reuse the same functions for the first question. It would give error 'Duplicate' function definition... I don't want to rename the names of instances for each new question. How can I reuse the same function for questions?

    Thank you

    This layer only for functions do not use to add event listeners. Add headphones when the answer buttons appear:

Maybe you are looking for