Creating a view to cast the field type

Hi All,
I had a table test with 2 fields key and time. time is of type timestamp.
i want to create a view on the table but cast the cast the time field from timestamp to datetime or date which can accomodiate the date and time.
I dont need the milli seconds in the view but require the date, time(hours:minutes:sec)
If anyone dis this earlies, please give some suggestions for me.
Regards,
KK

When i cast it to date only date "MM/DD/YY" is shown but time is not shown.Where are you looking to see this? A DATE column always has a time component. In order to display a date, however, it needs to be converted to a string. If you do not do an explicit TO_CHAR with an explicit format mask, in SQL*Plus, the conversion of a date to a string is governed by the session's NLS_DATE_FORMAT parameter. Various GUIs also have options to set or change the implicit format mask.
Most tools and databases default to only displaying the date component (the time component is always still there, it's just not displayed).
SQL> select * from vw_ts_to_date;
DT
27-FEB-09
SQL> select to_char( dt, 'DD-MON-YYYY HH24:MI:SS' ) dt_string
  2    from vw_ts_to_date;
DT_STRING
27-FEB-2009 16:58:09
SQL> ed
Wrote file afiedt.buf
  1* alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'
SQL> /
Session altered.
SQL> select * from vw_ts_to_date;
DT
27-FEB-2009 16:58:39Justin

Similar Messages

  • Modify the Field Type of standard Table fields in a Query

    Hello. I have a question.
    Is there a way to "modify" the field type for standard table fields that are included in a Query?
    I made a simple query out of a join of tables, but several fields have a lot of decimals, and I would like to present them in the query without any decimals, just as a regular "N" field.
    I tried the possibility of creating extra local fields where all I do is transfer the value to the new "N" field, but I have many fields like this, so if there's a better way; I'd prefer that.
    Maybe somewhere in the InfoSet there's a way to modify the type of the standard table fields?
    Thank you.

    Hi,
    This document may help you out.
    [http://help.sap.com/saphelp_erp60_sp/helpdata/en/d2/cb4468455611d189710000e8322d00/frameset.htm|http://help.sap.com/saphelp_erp60_sp/helpdata/en/d2/cb4468455611d189710000e8322d00/frameset.htm]
    Cheers,

  • How to read the field type from field id of DynamicFldTbl

    Hi,
    In my application, i am using DynamicFldTbl, whch parses FML32 field table definition file. My field table definition file contains information about field names and its types.
    I checked the API of DynamicFldTbl and didn't find any API to get the field type from field it.
    Any way to read the field type from field id?
    Thanks in advance
    Raguraman

    Hi Raguraman,
    Once you have the field table, you can then create an FML32 buffer (TypedFML32) using the constructor that takes a field table, and then use the Fldtype() method on the specific field ID you wish to get the type of. I know this is sort of tedious and we should provide Fldtype() and some others on the field table class directly.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Altering the field type in an AWT/Swing App

    Hi ,
    I have developed a simple Swing/Jclient application for ADF. All the fields produced on the panel are of type JTextField. Is it possible to alter some of them to JTextArea for example....????
    I have not noticed something relative to it in the property palette of each field.....!!!!
    Can i do that...????
    Note: I use JDev10.1.2
    Thanks....
    Sim

    So... if the fields are generated by the wizard then there is no manner to change the field type...????
    You can just drag a component from the data control palette and when you'll drop it on the panel it will give you various options of field types that you can drop it as.Yes... but how to relate it to a db column...(to bound to a db column of the selected table)????
    I have noticed that the fields generated by the wizard do have the "Document" property as the name of the object view + the db column produced as a step of the wizard.....
    For the item i have added as you have written the document property does not have this object view.name of db column as in the other columns....
    The possible values are:
    default
    defaultStyledDocument
    htmlDocument
    plainDocument
    Sorry , my question on this you have described....But , what about if i add another swing field type first and then i want to bound to a db column....???
    By the way, why are you using 10.1.2 and not 10.1.3?Does the newer version deal with these 'problems' better...???
    Thanks.. a lot for your constant help
    Sim
    Message was edited by:
    sgalaxy

  • Creating a view and use the view in a model

    Hi All,
    I am new to OBIEE and i have a requirement that i have two fields to be added to a subject area. Since we can't add queries directly to a model, i have to create a view and then put the query in it and then use the view in that model.
    I couldn't understand this much, if anybody could help me explaining in detail about the views and adding a query in it?
    Thanks
    Gohan

    Hi,
    Please refer the screen short below link
    http://imgur.com/b9sXS
    Right click any of one physial table(RPD physical layer) -> Select Properties -> from the properties windows choose 'Select' as Table type ->
    Please enable feature 'CREATE_VIEW_SUPPORTED' view just go to 'Features' tab and from the available option select 'CREATE_VIEW_SUPPORTED' is checked or not. If it is not checked then check the option.
    can you explain your current model and scenario?
    for example to you can use to fetch two fields from Subqueries,all trypes of joins(inner,left outer,right outer etc..,) its upto you case
    e.x:fetching two tables columns mapping subquery:
    SELECT column1, column2 FROM table1 WHERE column1 IN (SELECT column1 FROM table1
    INTERSECT SELECT column1 FROM table2 )
    SELECT column1, column2 FROM table1,table2 WHERE table1.column1 = table2.column1
    Alternative there is feature call "mulitple subject area" method will work (Union,Union all etc..,)
    Thanks
    Deva
    Edited by: Devarasu on Jun 6, 2012 4:40 PM

  • Return the file name of the field type BLOB

    How can I create the PL/SQL procedure that return the file name of the file insert into the record with a field file_date BLOB.
    I have this table:
    TEST
    with this item:
    file_name varchar2(20)
    file_date blob
    example
    I have insert with the OraclePortal Form a record:
    file_date Upload the file c:\test1.pdf
    I want that the my PL/SQL procedure insert into the field
    file_name the value test1.pdf
    Regards
    Basilisco Giorgio

    You may be confused by the error in Excel saying “another user”. Actually Excel cannot tell who (the real human) is editing the file. Based on my research the No.1 possibility of the error is KB2626998.
    2626998  Connection to a network document is lost in the 2007 Office system or in Office 2010 after the computer resumes from standby
    http://support.microsoft.com/kb/2626998
    For Excel 2010, follow these steps:
    a.  Click Start , click Run , type regedit in the Open box, and then click OK .
    b.  Locate and then select the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Options
    c.  On the Edit menu, point to New , and then click Dword Value .
    d.  Type NetworkAvailableTimeInSeconds , and then press Enter.
    e.  Right-click NetworkAvailableTimeInSeconds , and then click Modify .
    f.  In the Value data box, click Decimal , type a number value, and then click OK .
    Note This registry subkey sets the time, in seconds, that Excel waits for the network to resume. For example, if you type 15 for the number value, Excel waits 15 seconds for the network to resume. You might have to do some tests in your own environment to
    determine an appropriate value. You may have to try multiple numbers.
    g.  Locate and then select the following registry subkey.
    HKEY_CURRENT_USER\Software\Microsoft\office\14.0\common\Internet
    h.  Repeat step 2C through step 2F again. Reuse the same value that you used previously.
    i.  Exit Registry Editor.
    Feel free to post back. Thanks.
    Cheers,
    Tony Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please contact
    [email protected]

  • How to get the field type from the database dictionary in screen painter

    hi,
    I wanted to create a new input field that input field should have the data element from the structure that i have created. How to get the data field type from the database dictionary in the screen painter

    hi
    good
    there is two kinds of evernt
    PROCESS ON HELP-REQUEST
    PROCESS ON VALUE-REQUEST.
    which ll help you to give two types of help one is f1 help and another one is f4 help
    go through this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/47/e07f622b9911d2954f0000e8353423/content.htm
    thanks
    mrutyun

  • Create a view, some of the columns default are NULL

    Windows XP/10g 10.2.0.1.0
    I have a table tab1(test1, test2, test3)
    And, I need to create a views as:
    create or replace VW1(test1, test2, viewtest1, viewtest2) as (select test1, test2, viewtest1, viewtest2 from tab1, dual);
    And need the column value viewtest1 and viewtest2 to be default as null.
    Thanks.

    Are you looking for something like this ?
    create or replace VIEW VW1(test1, test2, viewtest1, viewtest2) as
             (select test1, test2, NULL, NULL from tab1);

  • Digital Publishing Suite Help | Creating custom viewer apps for the iPad and iPhone

    This question was posted in response to the following article: http://helpx.adobe.com/digital-publishing-suite/help/create-custom-viewer-app-ipad.html

    The Approval Status section is no longer in DPS App Builder, but this reference wasn't removed. You can submit your app to the gallery using this form:
    https://adobeformscentral.com/?f=ozjJFvlBionBofBtd-wjbQ#

  • What is the view to get the database type using oem grid

    Currently i have oem grid 11g , and i want to query a view where i can get the database type like (standalone, cluster database type).
    In OEM we have search option as database/cluster/clusterdatabase.....so for this type i want to check in database level in repository.Please provide me the view with in the grid repository.

    Some handy views can be found here:
    http://docs.oracle.com/cd/E11857_01/em.111/e12135/views.htm#BACCFCAB
    SQL> select target_type, count(*) from MGMT$TARGET group by target_type;
    TARGET_TYPE                      COUNT(*)
    osm_cluster                             3
    oracle_listener                        36
    oracle_exa_cisco_switch                 2
    oracle_exa_kvm                          2
    oracle_home                            68
    has                                    12
    rac_database                            3
    weblogic_j2eeserver                     2
    oracle_apache                           1
    oracle_ias_farm                         1
    oracle_exa_pdu                          2
    oracle_oms                              1
    cluster                                 3
    oracle_exadata_grid                     3
    oracle_exa_ilom                        12
    oracle_exadata_dbsys                    3
    oracle_oms_console                      1
    j2ee_application                        3
    metadata_repository                     2
    oracle_apm                              1
    oracle_exadata                         21
    oracle_ibswitch                         5
    oracle_dbmachine                        3
    oracle_ibnetwork                        2
    oracle_beacon                           1
    oracle_oms_pbs                          1
    oracle_em_service                       2
    oracle_dbsys                           18
    oracle_emd                             25
    osm_instance                           12
    oracle_database                        27
    host                                   25
    weblogic_domain                         1
    oracle_emrep                            1
    34 rows selected.Good luck.

  • How to create a pamater id for the field

    Hi,
    in fbl5n transaction for the  open item (key date) doesnt have parmater id , i need to create parameter id for that field,,,
    how to create paramter id for that particulatr , because in technical setting that parameter id is not specified....
    pls help

    in fbl5n transaction for the open item (key date) doesnt have parmater id
    Since it is a Standard Transaction, you cannot create the Parmeter id for it.
    You have to create a Mod, using access key and modify the dataelement.
    I am not sure this is the correct way. check other possibilities.

  • How to create a view to perform the following

    I have a table as below:
    Name Date           Amount
    A     01.09.2011     100
    B     01.08.2011     200
    C     04.05.2011     300
    I need to write a view in SQL to get the following:
    Name Upto 30days Upto 30-60days     Upto 60-90days
    A 100
    B 200
    C 300
    Edited by: 883762 on Sep 7, 2011 5:59 AM

    WITH src AS
    (   SELECT 'A' name, to_date('01.09.2011','dd.mm.yyyy') dt, 100 amt FROM DUAL UNION ALL
        SELECT 'B'  ,to_date('01.08.2011','dd.mm.yyyy'), 200 FROM DUAL UNION ALL
        SELECT 'C'  ,to_date('04.05.2011','dd.mm.yyyy'), 300 FROM DUAL
    SELECT
        name,
        CASE
            WHEN dt >= TRUNC(sysdate) - 30 THEN
                amt
        END upto_30_days,
        CASE
            WHEN dt >= TRUNC(sysdate) - 60 AND dt < TRUNC(sysdate) - 30 THEN
                amt
        END btn_30_and_60,
        CASE
            WHEN dt >= TRUNC(sysdate) - 90 AND dt < TRUNC(sysdate) - 60 THEN
                amt
        END btn_60_and_90
    FROM
        srcHTH
    David

  • Unable to locate the xml-definition for FieldName with FieldId '1f8a351c-965d-4927-9c22-8772b7089f55' when trying to activate feature with references a custom field type

    I´ve a solution which contains a custom field type (found somewhere on the net, the custom field type maps a choice field to managed metadata). There is a second solution which contains site column and site content type definitions using the custom field
    type definition from field type solution.
    On my developement environment, there is no problem with this two solutions. When field type solution is deployed, i can deploy the content type solution and activate the feature and everything is fine.
    However if i give the two solutions to our adminstrator to deploy them into our staging environment, content type feature activation fails. Deploying the field type solution makes no problems. The field type is then available and i can manually creates
    columns with this new field type. However activating the content type solution fails with the error shown in the title of this message. The FieldID from the message is not part of my content type project. Searching the net doens´t show any results for that
    id. So i think it´s not some of the standard field id´s from sharepoint.
    Can anyone help?

     Stack Trace
    Unable to locate the xml-definition for FieldName with FieldId '1f8a351c-965d-4927-9c22-8772b7089f55', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes) -
    -- End of inner exception stack trace ---
    at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
    at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    at Microsoft.SharePoint.SPFieldCollection.FetchFieldsFromWeb()

  • Swapping the fields in a view cluster

    Hi
    I have a view cluster with the fields in the order FIELD1, FIELD2, FIELD3, FIELD4.
    My requirement is that it should come in the order FIELD1, FIELD4, FIELD3, FIELD2.
    Help me on this.
    Thanks in advance.
    Regards
    Karthik

    after fetching you can pass them to the required order into another internal table of the required order.
    or define you internal table the way you want the data to come and in select statement it self you can use into corresponding fields to get the data in their respective positions

  • How to get the field's type in the database with jdbc?

    How to get the one filed's type(varchar,int,long...etc) with jdbc??
    Can u help me??
    It's best that giving a sample code..

    Thx for your reply,BheegaChicken! But i use it with
    oracle9i jdbc..It doesn't return to my the fields
    type correctly..
    This is problem is caused by oracle jdbc??
    Can u tell me??It depends on the driver classes you are using... some of them don't have an implementation for those methods and you won''t get anything useful. Check the driver documentation.
    ***Annie***

Maybe you are looking for