Select type without to_char date time

I have the table T (myDate date, + about 15 columns). When I insert values in there, I also inserts a date time.

If I want to see all of the data in the table, I have to call to_char on column myDate. If you need to write all 15 column names in the select.

I would simply write a select * from T, but see time for myDate as well. Is this possible?

Thank you

You can use alter session in a session of SQLPlus

See this example:

SQL>
SQL> select * from emp
  2  where rownum <=2;

     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30

SQL>
SQL> alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';

Session altered.

SQL>
SQL> select * from emp
  2  where rownum <=2;

     EMPNO ENAME      JOB              MGR HIREDATE                    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- -------------------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30

Kind regards.
Al

Tags: Database

Similar Questions

  • without discount date when select select list

    Hello

    I have two field
    1. select list
    2-date picker

    now, I want to when I select a value in to select the list, and then the corresponding date value should come to date picker point field.i want it without updating date picker.


    How can I do this

    Hello

    I guess that your date is in the table?

    Something like this in the HTML page header

    function fetchDate(){
        var ajaxReq = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=GET_DATE',0);
        ajaxReq.addParam('x01', $v('Px_YOUR_SELECT_LIST'));
        var lRet = ajaxReq.get();
        $x_Value('Px_YOUR_DATE_PICKER', lRet);
        ajaxReq = null;
    }
    

    Then the process of request GET_DATE

    DECLARE
     l_d VARCHAR2(32000);
    BEGIN
    
      SELECT TO_CHAR(your_date_column, 'DD.MM.YYYY') -- Check date format. Set same as date picker
      INTO l_d
      FROM your_table
      WHERE your_column = apex_application.g_x01;
    
      HTP.PRN(l_d);
    
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        HTP.PRN('No data found !');
      WHEN TOO_MANY_ROWS THEN
        HTP.PRN('More than one date found !');
      WHEN OTHERS THEN
        HTP.PRN(sqlerrm);
    END;
    

    And add onchange = "fetchDate (); "to select the attributes of the list HTML form element
    BR, Jari

    Published by: jarola November 21, 2009 12:56

    Published by: jarola November 21, 2009 13:05

  • extract date date time zone type

    I have a coming date time zone from Java code in varchar format
    2013-02-15T01:00:00-06:00
    I need extract the date and time of the varchar above to proceed further in my PL/SQL code. IM pretty don't know what mean the "T" in the date box. Please enlighten us. I use Oracle 10 g 2 version.

    You might try this:

    SELECT TO_TIMESTAMP_TZ ('2013-02-15T01:00:00-06:00',
                            'YYYY-MM-DD"T"HH:MI:SS TZH:TZM')
      FROM DUAL;
    

    See you soon,.
    Manik.

  • change the selection date &amp; time in PSE 8 Mac/bridge

    OK, maybe it's the Jet lag. I downloaded all my vacation photos and realized that I had forgotten to adjust the camera date/time zone time. I remember that earlier versions of Windows PES had the ability to adjust the tour time batch, but I can't find it in CS4 Bridge or PSE 8 Mac. I really want to do it manually for a couple hundred pictures. Is the ability to hide in there somewhere? THX

    There are dozens of free utilities that will do, and I think you may even be able to do with automator. Here is an example of a free utility (have not used it myself, caught the first of dozens that came when I googled). I think that Graphic Converter can also do (it can batch change all kinds of EXIF, so I guess that the timestamps are included)

  • [8i] problem of calculation of Date/time...

    So I am currently faced with a situation where I need to calculate the total number of hours that a workstation is in use for each day in a given period. I have a table with newspaper each time that each workstation is used. The problem is a workstation can be used for any period of time, commencing on any day and ending on any day. This means that a particular log entry may extend over several days. I don't know how to split the difference between the time of the end of an entry and departure date/time of entry over several days.

    Here is a sample table and some sample data for what I'm doing:
    -- Note: in reality, this table contains more columns
    CREATE TABLE     my_hrs
    (     record_id     NUMBER     NOT NULL
    ,     sdatetime     DATE     
    ,     edatetime     DATE     
    ,     workstation     VARCHAR2(4)
         CONSTRAINT my_hrs_pk PRIMARY KEY (record_id)
    );
    
    -- Note: sdatetime, edatetime, and workstation CAN all be NULL, though I won't provide
    -- any sample data for these situations since I want to ignore them in my results
    -- Additionally, there are hundreds of workstations, but I'm only using 2 to simplify the sample data
    
    INSERT INTO     my_hrs
    VALUES (12345,TO_DATE('03/01/2010 08:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 13:35','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (13427,TO_DATE('03/01/2010 08:10','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 10:02','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (21543,TO_DATE('03/01/2010 14:07','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 16:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (22412,TO_DATE('03/01/2010 10:15','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 15:30','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (11976,TO_DATE('03/01/2010 17:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/02/2010 02:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (34215,TO_DATE('03/01/2010 22:10','mm/dd/yyyy HH24:MI'),TO_DATE('03/02/2010 04:30','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (24789,TO_DATE('03/02/2010 13:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/05/2010 02:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (31542,TO_DATE('03/02/2010 21:30','mm/dd/yyyy HH24:MI'),TO_DATE('03/04/2010 10:30','mm/dd/yyyy HH24:MI'),'321B');
    According to my data in the example above, these are the results I want to see:
    WORKSTATION     DATE          HRS_IN_USE
    ------------------------------------------
    123A          3/1/2010     14.96667
    321B          3/1/2010     8.95000
    123A          3/2/2010     13.50000
    321B          3/2/2010     7.00000
    123A          3/3/2010     24.00000
    321B          3/3/2010     24.00000
    123A          3/4/2010     24.00000
    321B          3/4/2010     10.50000
    123A          3/5/2010     2.50000
    321B          3/5/2010     0.00000
    Is this possible? (Please note that if the workstation was not used on a particular day, I want to show him 0 for this workstation for that day). Another thing to note is that I work with Oracle 8i.

    Thanks in advance for the help!

    Hello

    user11033437 wrote:
    Sorry, bind variables are DATEs.

    Where are you running that? I assumed it was SQL * Plus, where the bind variable can not be DATEs.
    That's exactly why I wanted a full test case.

    user11033437 wrote:
    The WHERE clause is the culprit here.

    SELECT  p.min_date  + ROWNUM - 1      AS a_date
    ,     p.min_date + ROWNUM         AS next_date
    FROM     all_objects
    ,     (     -- Begin in-line view p to define parameters
              SELECT      :start_date  AS min_date
              ,      :end_date  AS max_date
              FROM      dual
         ) p     -- End in-line view p to define parameters
    -- WHERE     ROWNUM <= p.max_date + 1 - p.min_date --this is causing the error
    

    Published by: user11033437 on March 12, 2010 09:02
    Replaced the post with something SPECIFIC

    Thanks, I appreciate it.
    A surprising number of people on this forum does not seem to see the value of posting something specific. It's a great relief to work with someone who does.

    I said how I could not simply subtract two dates, t1d - T2D, in a place determined; I had to use TO_NUMBER (t1d - T2D). Maybe even workaround will be used here.

    user11033437 wrote:
    When I run the subquery p by itself and add a line to avoid the sdatetime of edatetime and look at the results, it seems that he could return the difference between two days of a type of INTERVAL data, rather than a number...

    SELECT      :start_date  AS min_date
              ,      :end_date  AS max_date
              ,      :end_date - :start_date AS my_int
              FROM      dual
    

    I discovered that if in the end I have will be querying this database and another, however the other database is Oracle 8i, 9i is obviously...

    sigh of frustration

    It may seem reasonable (at the time your conclusion and your frustration): intervals have been introduced in Oracle 9. (However, I noticed that sometimes "what's new" were actually available, although without papers, in earlier versions).
    Yet once again, how are the bind varibales defined? Looks like they are the timestamps. Subtracting two DATEs results in a NUMBER, but by subtracting two stamps produced an INTERVAL. You can change to the DATEs where they are defined?
    Try to use TO_DATE or CAST in the subquery p, to ensure that it produces DATEs:

    ,     (     -- Begin in-line view p to define parameters
              SELECT      CAST (:start_date AS DATE)  AS min_date
              ,      CAST (:end_date   AS DATE)  AS max_date
              FROM      dual
         ) p     -- End in-line view p to define parameters
    
  • Bar code, select type automatically

    Hi, actually I think that if we can do a VI that will decode a bar code without the user to select the type of barcode... given on the condition that the user does not know the type of bar code...

    And this is the example of the player code 1 d barcode, provided by the NOR...

    So I think that using a loop through each type of bar code, given that an enum... then there must be a correct output while others will result in errors.

    But I do not know how to view the data type without errors occur...

    Can someone tell me how to make or you have a better way to achieve this process?

    Put the code bar vi in a FOR LOOP and exit the error cluster in table form.  Then you can read the Boolean error to determine what value of the index has a correct result.

  • date, time and numbers of extractions

    Hi all

    Please inform me how can I extract just the full date, time with only AM/PM and numbers with or without decimal point.

    in the following query is extracted from the Date.

    Select regexp_substr ("Welcome to 08/08/2012 ',' [0-9] {1,2} [[: punct:]] ([0-9] {1,2} |)") [[: alpha:]] ({3}) [[: punct:]] [0-9] {4}') datesubstr
    of the double
    ;

    How can I correct the time as in the following
    SELECT REGEXP_SUBSTR (' Hello 12/12/2008, 10:22 nnnm mnj Sarah ',' [0-9,-------.] + [AM, PM]') result OF double;

    and how do I extract only numbers and numbers with a decimal point

    SELECT REGEXP_SUBSTR (' Hello to Sarah mnj nnnm 8898989898989 ',' [0-9,.]) ({1,}') are the result OF double;

    concerning

    Hello

    Isabelle wrote:
    Thanks a lot for you

    but
    SELECT REGEXP_SUBSTR (' Hello to 8898989898989.) Sarah nnnm mnj'
    , '([0-9]+\. [0-9]*)'     || -Start by number (s) (it may or may not have numbers after).
    '|'               || -or
    '(\. ([0-9] +)'-begins with a decimal point
    ) AS a result
    OF the double
    ;

    "If the numbers such as ' 9.11.2012 ' is not necessary to extract.
    I want to extract only when like this 9.11 or this 9,11 tike who is only average a decimal point.

    Your needs are still vague. No joke, you have to say exactly what your needs are and to give other examples. After 5 to 10 rows of sample data (CREATE TABLE and INSERT statements) and the results desired from these data. Explain why you want the results of these data.

    If you want to treat ',' as a decimal point as possible, how you stand out from the other commas? For example, the string would contain a list of integers, such as

    1,2,3,5,8
    

    ? If so, what happens if the entire string is

    1,2
    

    ? Would that be one (equal to 6/5) number or two numbers (integers 1 and 2)? Include examples in your sample data and results.
    I still don't know if a comma is necessary.

  • changing dynamic date/time format

    How can I set a Date/time format) of a textbox (behave like a phone number format, where the user enters only numbers, but it shows another way of my choice.)

    Download the new Date object
    var a = event.target.value;

    Kai var = util.scand ("YYYYMMDD", a);


    dd/mm/yyyy format
    xDate var = util.printd ("yyyy/mm/dd", anyway);

    Event.Target.Value = xDate;

    It does not work.

    Text type fields have scripts that control the key sequence, validation and formatting. You only play with the formatting.

    You could create a script to strike to allow the entry of the date with or without the "/" but you then have to write a script of presentation and validation. Posting date is not just month 1-12 and day 1-31, because some months have 28, 29, 30 or 31 days depending on the month and year combinations.

  • Get VM create Date &amp; time

    Hello

    I'm looking to get the GET the VM code create Date & time.

    The reason why see you the same entries twice was because the events are collected in the VC and the script does not specify a specific cluster.

    The reason why I did not use the - parameter, the Get-ViEvent cmdlet entity was because not all the tasks are performed on a cluster but could belong to a weaker entity in the structure (for example, an ESX host).

    The following adaptation of the script will also include the NOMCLUSTER and the ESX host name where the guest was created.

    You could adapt the script to test on the name of the cluster or ESX host.

    The reason why the name of the cluster and ESX host are obtained in a heavy way is because there seems to be a bug in the references managed object the Get-ViEvent cmdlet returns.

    # How many days in the past to start from
    $start = (Get-Date).AddDays(-10)
    
    # The more days back, the higher this number should be.
    $eventNr = 9999
    
    $report = @()
    
    Get-VIEvent -Start $start -MaxSamples $eventNr | `
    Where-Object {$_.GetType().Name -eq "VmCreatedEvent"} | % {
         $row = "" | Select Date, Msg, User, Cluster, Host
         $row.Date = $_.createdTime
         $row.Msg = $_.fullFormattedMessage
         $row.User = $_.userName
    
         $t = New-Object VMware.Vim.ManagedObjectReference
         $t.type = $_.computeResource.computeResource.type
         $t.Value = $_.computeResource.computeResource.Value
         $row.Cluster = (Get-View $t).Name
    
         $t.type = $_.host.host.type
         $t.Value = $_.host.host.Value
         $row.Host = (Get-View $t).Name
    
         $report += $row
    }
    $report
    
  • How is the best way to have the ' create date &amp; time ' to print a picture?

    I'vehas attempted to make a script to work, but since I don't know what I'm doing, without success.  I use CS2, and as if so I didn't update.  If I need to upgrade to get something to go, I'll do it.  Meta data.

    Any suggestions appreciated,

    You could get the date and time of the imformation exif... IE:

    This should add create Date and time into your open document.

    main();
    function main(){
    if(!documents.length) return;
    var exifArray =activeDocument.info.exif;
    for(var a in exifArray){
        if(exifArray[a][0].match(/^date time orig/i)){
            var dateTime = exifArray[a][1].toString();
            break;
            }
    }
    //Amend to suit
    var Percent = 50; //The text is the percentage of smallest side
    var blendmode = activeDocument.activeLayer.blendMode.toString().replace(/blendmode./i,'');
    var Opacity = parseInt(activeDocument.activeLayer.opacity);
    var TextInfo = dateTime;
    var Black = new SolidColor();
    Black.rgb.hexValue = '000000';
    var newTextLayer = activeDocument.artLayers.add();
    newTextLayer.kind = LayerKind.TEXT;
    newTextLayer.textItem.kind = TextType.POINTTEXT;
    newTextLayer.textItem.color = Black;
    newTextLayer.textItem.font = "Georgia";
    newTextLayer.textItem.size = 10;
    newTextLayer.textItem.contents = TextInfo;
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var myDoc = activeDocument;
    var LB = myDoc.activeLayer.bounds;
    var docHeight = myDoc.height;
    var docWidth = myDoc.width;
    var LHeight = Math.abs(LB[3].value) - Math.abs(LB[1].value);
    var LWidth = Math.abs(LB[2].value) - Math.abs(LB[0].value);
    var percentageHeight = ((docHeight/LWidth)*Percent);
    var percentageWidth = ((docWidth/LWidth)*Percent);
    if(docWidth < docHeight){
    myDoc.activeLayer.resize(percentageWidth,percentageWidth,AnchorPosition.MIDDLECENTER);
    }else{
      myDoc.activeLayer.resize(percentageHeight,percentageHeight,AnchorPosition.MIDDLECENTER);
      }
    align('AdCH'); align('AdBt');
    activeDocument.activeLayer.translate(0,-10);
    app.preferences.rulerUnits = startRulerUnits;
    }
    function align(method) {
    activeDocument.selection.selectAll();
       var desc = new ActionDescriptor();
               var ref = new ActionReference();
               ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
           desc.putReference( charIDToTypeID( "null" ), ref );
           desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
        try{
       executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
       }catch(e){}
       activeDocument.selection.deselect();
    };
    
  • Extended metadata date / time shift

    Up for it seems that Lightroom 3 can only enter a new date / time for the Meta data creation / change / change the values. Or it can change the weather not 1 hour to fix timezone problems whitin has set +/-range.

    Now imagine all that I have image files from different cameras on the same event and the internal time of the device is not the same to any camera, medium, for example a camera time is 20 minutes late (-20 min) compared to another device. Of course, so I could enter a time for the moment of creation in lightroom directly. But I should do for 300 images?

    I need a function extended the date / time modified:

    It should be possible to make a change of the batch of pictures of +/-hh to adapt the images from a camera (which had a bad interal time setting) to real-time or at least an hour from another device (of course you need to know the difference in time between the hours of the camera).

    Such a function is properly provided by the software bit EXIFTool - but it isn't pleasant manage files outside of Lightroom image comes to alter time. And Lightroom already has a function for this - but its possibilities are not good enough.

    Please implement this as soon as possible.

    Best regards

    Jochen

    If you type "change the capture time" on the Help menu, you'll find this:

    If more than one photo is selected in the grid, Lightroom changes the capture time for the active photo of the specified adjustment. (The active photo is presented as a preview in the Edit Capture time dialog box.) Other photos of the selection are adjusted by the same amount of time. If more than one photo is selected in the Filmstrip in Loupe mode, comparison, or investigation, the capture time is changed only on the active photo.

    This should answer your question.

  • Recover/place current date-time in the text box

    Hello, I wonder if someone has experimented with dynamically retrieve the current computer date/time and place this information in a text box? Looks like a simple enough action, but I can't find any documentation related this topic. I suspect that this method of appeal and retrieval behavior could serve as unexpectedly in many situations for many people!

    -joel

    You don't need a script to do this.  In the Type menu, there is a submenu "text... Variables. ».  This will set text variables and store them in text boxes.  There is a predefined variable called "Release Date", which will display the date current (MM/DD/YY) when a PDF file is output.  If you want to display the time, under "text... Variables. ', go to 'Define'... ", and you can define your own.  Under 'Type', select the release date and add any desired variable data.  The format of date and time should look like this:

    HH: mm: MM/DD/YY

    I found that only update text Variables in the display very consistantly, but I just tested it, and whatever the value is, the PDF output has time and date.

    If you want to control the text with javaScript variables, see the classes of TextVariableInstance (s) and TextVariable (s).

    As a side note, the text variables work very well if you want the date and time, page, etc., but I really wish they would add a little more features, especially with things like name of separation, color profile, and PDF output profile.  It would be a huge timesaver that all of this type of metadata inserted easily.

  • How to get current utc date time in oracle

    Hello

    SYSDATE shows date current time in the time zone based on SessionTimeZone. Is there a built in function or in some other way to get the current utc date time without changing the value of the SessionTimeZone.

    Thank you
    YG

    Or

    SELECT SYS_EXTRACT_UTC(SYSTIMESTAMP)UTC_SYS, SYSTIMESTAMP FROM DUAL; 
    

    * 009 *.

  • icon of camera on date/time/intro page

    I just noticed the camera down icon to the right of my iPhone screen.  I don't remember seeing before.  It's on the screen that appears after the phone has not been used for some time.  The page with the date, time and "slide to unlock" message.

    I can't figure out how to make the camera icon to go away and it's scary.  Clues?

    Thank you.

    The icon of the camera on the lock screen to take a photo without unlocking the phone. Simply drag the icon to the top and you will be behind closed doors, mode

  • Daylight Saving Format Date/Time String vs get time in seconds

    Hi all

    I have developed a real-time application using a cRIO 9074 which has two loops. The first gathers data and records the time using the module of ' string of Format Date/time ' with the following time sting: '%d/%m/%Y % H: %m ". The output is a sting with mouth/day/year hour: minute.

    The second loop Gets the cRIO time using the module "get Date/Time in Seconds ' and the output of timestamp is sent by a shared variable for an application that is running on a local computer.

    The problem started Sunday last with DST. With the help of MAX I am able to see that the time of cRIO is bad (1 hour less) and that him "automatically adjust clock for daylight saving time" is not checked and gray, so I am not able to change it.

    The time of the first loop by using the "Date and time Format string' returns the time elapsed between the cRIO (1 hour late), however the time of the second loop is OK. I have manually corrected time using MAX, so now the first loop is correct, and the second is now over an hour.

    Any ideas?

    Dear RavensFan, thank you very much for your answer.

    However, this was not the problem. Apparently the result with or without the element of DST is the same. I solved the problem, for now, by changing a parameter not on the function "get Date/Time in Seconds" but on the time stamp indicator.

    By right clicing the indicator and go to the display Format and the advanced editing mode, I have changed the Format string to a universal time container of this: %< %="" h:="" %m="">< t="" %="" ^="">< %="" h:="" %m=""><>

    Apparently the time from the 'get time in seconds' is still an hour longer, but now it is correctly displayed.

Maybe you are looking for

  • VRML

    I have craeate a robot 2 dof with VRML. I want to move it.Can you help me please?

  • turn off the automatic loading of the taskbar icon

    How can I keep a form unwanted icon in the taskbar of loading?  The program has been uninstalled, but the icon still load on reboot.

  • bad display Desktop HP Pavilion dv7 notebook

    When I connect to the computer, I have red swirls grainy on my screen and my icons on the desktop all have a shadow on the right side of the icon is red.  My pages are now a beautiful blue color striped instead of white.  How can I fix it?

  • Skype in blackBerry Smartphones

    Is Skype available for blackberry curve 9320?

  • Cisco IOS 12.4 vs 15.1

    Hey, I heard that IOS 15 is basically 12 with more features. Remain the same all orders or are there changes in the structures of command for some parts?