Reg: View column datatype

Hi Team,
While creating the views, column automatically converted into varchar2(81) data type from number datatype.
but stage1 table has legacy_trx_number is number data type and statg2 table has header_num is number data type.
Just i added the highlighted part in the view. So automatiicaly converted number to varchar2 datatype. How to keep data type remain the same as source stage table datatype even though those columns used in the view.
CREATE OR REPLACE VIEW test_view  AS
    SELECT h1.legacy_trx_number
      ||'.'
      ||h2.header_num legacy_trx_number,
      h1.legacy_trx_date,
      h1.ledger_id,
      h1.legal_entity_id,
      h1.header_record_identifier,
      h2.header_num,
      h2.gl_date,
      h2.header_value_full,
      h2.header_value
    FROM stage1 H1,
      stage2 H2
  WHERE h1.header_record_identifier = h2.header_record_identifier;
Please help give me suggestion on this.
Thanks in advance.

You can do it like this!
Example:-
SQL> ed
Wrote file afiedt.buf
  1  create view v_num_test
  2  as
  3* select to_number(5478||'.'||87489) result from dual
SQL> /
View created.
SQL> select * from v_num_test;
    RESULT
5478.87489
SQL> desc v_num_test
Name                                      Null?    Type
RESULT                                             NUMBER

Similar Messages

  • Re: Reg: View column datatype

    Hi All,
    After changing it, I was getting the output like for legacy_trx_number.
    220135.1
    220135.2
    220135.3
    220135.4
    220135.5
    220135.6
    220135.7
    220135.8
    220135.9
    220135.1 -- It should be 220135.10 after converting into to_number(h1.legacy_trx_number||'.'||h2.header_num legacy_trx_number)
    220135.11
    220135.12
    220135.13
    220135.14
    220135.15
    220135.16
    If it is varchar2 data type then i was gettign the correct output from view query output. can you let me know how to avoid this problem.
    Thanks in advance.

    In addition to your previous thread, you have 3 choices: -
    1) If a table/view is created with number datatype with precession 2, then 220135.10 value will be stored as 220135.1 in it. In short number type ignores trailing zero after decimal.
    2)  You can stick to your view creation with varchar2 datatype.
    3) Or as Blu suggested, you can display using to_char with format code. Like for  TO_CHAR( 220135.1, 'FM999999.00' ). But along with this, your all decimal part( before 10) will also have a trailing zero with them.
    Thanks!

  • In user_tab_cols the data_type is 'undefined' for view columns

    Can anyone please confirm if this is the correct behaviour ?
    select table_name, column_name, data_type from user_tab_cols
    where table_name = 'AR_RCT_CUST_H_V'
    AR_RCT_CUST_H_V     RCT_CUST_ACCOUNT_NUMBER     UNDEFINED     
    AR_RCT_CUST_H_V     RCT_CUST_TYPE     UNDEFINED     
    AR_RCT_CUST_H_V     RCT_CUST_ACCOUNT_ID     UNDEFINED
    This view ( AR_RCT_CUST_H_V ) is created using force view command.
    Also which table can I query to see the correct datatype for the view columns ?
    database version : 11.1.0.6.0
    Thanks,
    Debraj.

    NVL (data_precision, 0) PRECISION
    nvl function replaces all nulls with what ever your given value.
    Thanks,
    surya

  • How to retrieve view column type?

    I know how to retrieve column names and comments from
    table all_col_comments.But I don't know retrieving view column type.If somebody know please help.

    ALL_TAB_COLUMNS
    ALL_TAB_COLUMNS describes the columns of the tables, views, and clusters accessible to the current user. To gather statistics for this view, use the SQL ANALYZE statement or the DBMS_STATS package.
    Related Views
    DBA_TAB_COLUMNS describes the columns of all tables, views, and clusters in the database.
    USER_TAB_COLUMNS describes the columns of the tables, views, and clusters owned by the current user. This view does not display the OWNER column.
    Column Datatype NULL Description
    OWNER
    VARCHAR2(30)
    NOT NULL
    Owner of the table, view, or cluster
    TABLE_NAME
    VARCHAR2(30)
    NOT NULL
    Name of the table, view, or cluster
    COLUMN_NAME
    VARCHAR2(30)
    NOT NULL
    Column name
    DATA_TYPE
    VARCHAR2(30)
    Datatype of the column
    DATA_TYPE_MOD
    VARCHAR2(3)
    Datatype modifier of the column
    DATA_TYPE_OWNER
    VARCHAR2(30)
    Owner of the datatype of the column
    DATA_LENGTH
    NUMBER
    NOT NULL
    Length of the column in bytes
    DATA_PRECISION
    NUMBER
    Decimal precision for NUMBER datatype; binary precision for FLOAT datatype, null for all other datatypes
    DATA_SCALE
    NUMBER
    Digits to right of decimal point in a number
    NULLABLE
    VARCHAR2(1)
    Specifies whether a column allows NULLs. Value is N if there is a NOT NULL constraint on the column or if the column is part of a PRIMARY KEY.
    COLUMN_ID
    NUMBER
    NOT NULL
    Sequence number of the column as created
    DEFAULT_LENGTH
    NUMBER
    Length of default value for the column
    DATA_DEFAULT
    LONG
    Default value for the column
    NUM_DISTINCT
    NUMBER
    These columns remain for backward compatibility with Oracle7. This information is now in the TAB_COL_STATISTICS views. This view now picks up these values from HIST_HEAD$ rather than COL$.
    LOW_VALUE
    RAW(32)
    HIGH_VALUE
    RAW(32)
    DENSITY
    NUMBER
    NUM_NULLS
    NUMBER
    Number of nulls in the column
    NUM_BUCKETS
    NUMBER
    The number of buckets in histogram for the column
    Note: The number of buckets in a histogram is specified in the SIZE parameter of the SQL statement ANALYZE. However, Oracle does not create a histogram with more buckets than the number of rows in the sample. Also, if the sample contains any values that are very repetitious, Oracle creates the specified number of buckets, but the value indicated by this column may be smaller because of an internal compression algorithm.
    LAST_ANALYZED
    DATE
    The date on which this column was most recently analyzed
    SAMPLE_SIZE
    The sample size used in analyzing this column
    CHARACTER_SET_NAME
    VARCHAR2(44)
    The name of the character set: CHAR_CS or NCHAR_CS
    CHAR_COL_DECL_LENGTH
    NUMBER
    The length
    GLOBAL_STATS
    VARCHAR2(3)
    For partitioned tables, indicates whether column statistics were collected for the table as a whole (YES) or were estimated from statistics on underlying partitions and subpartitions (NO).
    USER_STATS
    VARCHAR2(3)
    Were the statistics entered directly by the user?
    AVG_COL_LEN
    NUMBER
    Average length of the column (in bytes)
    CHAR_LENGTH
    NUMBER
    Displays the length of the column in characters. This value only applies to the following datatypes:
    CHAR
    VARCHAR2
    NCHAR
    NVARCHAR
    CHAR_USED
    VARCHAR2(1)
    B | C. B indicates that the column uses BYTE length semantics. C indicates that the column uses CHAR length semantics. NULL indicates the datatype is not any of the following:
    CHAR
    VARCHAR2
    NCHAR
    NVARCHAR2
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch2143.htm#1302694
    Joel P�rez

  • Reg., View

    Question
    Is there a way to retrieve the actual columns &expressions of a view, using a SQL Statement ?
    Background
    I have a view based on some tables & views. The tables lying below the view will vary from time to time and for different parts of the world, in their own databases. (agreed thats not the best way of doing it, but you know all these tables exist for a long period and lot of other applications are built around these tables locally in all the global locations)
    The view has 178 columns and its been a big pain to back track, from which table/column is a view column derived,(again for different countries it varies). I can always take a look at the select statement and find out. Still I want to automate the process and hence tryig to build a query that returns:
    View_col View column Name
    Actual_table Actual Table name
    Actual_col Actual Col name
    Expression Substr,Trunc,To_char, etc...
    Pls pass on some suggestions to achieve the same. I am being told that its not possible,
    still wanted to give it another try.
    Madhu.

    I think that the only way to achieve this is that you process the SQL that creates the view (in USER_VIEWS or DBA_VIEWS). I have no knowledge of a table that stores the type of information that you want.

  • SharePoint 2010 : How to display ALL Version History of a list item's multiline text box in a same list as a list view column?

    In SharePoint 2010 , I have version history enabled multiple text box 'issue details'.  Users mainly uses Data Sheet view and it does not show all version history of that multiple line text box, is there anyway we can display list view column in
    data sheet view to display all version history?
    2) If we can not display in datasheet view, in standard view, it should display all version history instead of just a link  to -view all entries'
    I have found one article here and it posts to use below line of code in sharepoint desinger
    <SharePoint:AppendOnlyHistory runat="server" ItemId="{$thisNode/@ID}" FieldName="Issue_x0020_Details" ControlMode="Display"></SharePoint:AppendOnlyHistory>
    WHen I use this line of code , it displays multiple line of same version history instead of each, please help.

    Hi
    Greetings. Hope it helps 
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/d1be5434-7dc9-4941-bf1d-8c12d7e6a155/display-version-history-in-list-view-column?forum=sharepointcustomizationlegacy
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • View Column info not displaying in Columns Tab

    Running XP SP2 and SQL Developer 1.5.1 5440
    When looking at views that are using tables from another schema. I don't see any of the columns information. I have DBA role
    In rel 1.1.2.25 2579 I see them just fine. (Both loaded on machine right now)
    Is this a bug or do I have a setting problem?

    Barry,
    As a "disclaimer", the points below are based on my usage of SQL Developer and things that bug me about how it works or doesn't work - I know that there are more important things to fix than a number of these.
    On to the basics ... and the most basic of the basics for a tool like SQL Developer:
    1) Problems with data dictionary queries in navigator or object tabs:
    - Triggers not listed in Table tab if trigger owned by different schema to table owner
    - Index columns not listed in Table tab if index owned by different schema to table owner
    - View columns not listed in View tab if view owned by different schema to current user
    - Dependencies not listed in Table/View tab if other object owned by different schema to object owner
    - Performance of Table Node (outer join added in 1.5.1)
    - there are a lot of other posts about the supplied data dictionary queries not producing the right results and I often find that I am querying the data dictionary directly in a SQL Worksheet for information that should be correct in the navigator/object tabs
    Basic things that I expect to work in a tool like SQL Developer (or to work given that they have been included):
    1) Popup Describe problems
    - schema name is case sensitive, so doesn't find owner.object
    - synonym overrides schema name (OWNER.OBJECT will describe local OBJECT synonym instead of OWNER's object)
    - position based object name selection includes punctuation
    2) Bind variables that work properly in PL/SQL (both Execute Statement and Run Script)
    3) Package decomposition in object navigator doesn't report variables or constants of custom types and lists object.column%type constants as "constant"
    4) Exporting query results re-executes query to display Export dialog - this presents as SQL Developer freezing after selecting the Export menu option for queries that take a long time for first record to appear
    I would use SQL Developer more (or more of SQL Developer) if:
    1) More integrated file based development - I still do the bulk of my object creation (largely PL/SQL and views) editing in Wordpad and running via SQL*Plus largely because I get better error reporting.
    - display the compile message tab when using the compile button for a file
    - show errors doesn't work for views
    2) Running Reports hang SQL Developer - I still have my SQL scripts for my common queries, which I can run through SQL Worksheet in a much friendlier fashion (I can cancel them and they don't hang SQL Dev) than I can run reports
    Problems that detract from the "polish" of SQL Developer, but don't really have a big impact on usage but discourage me from trying to "convert" non-techie TOAD using colleagues:
    1) Multiple TNSNAMES files read - generates multiple entries
    2) Export of long string literals causes ORA-972 error
    3) "Statement Processed" feedback is extremely sensitive to spaces ("create Statement Processed" where two spaces between the create and view keywords) and assumes simple statements ("create unique Statement Processed" or "create or replace force Statement Processed" as examples)
    I think that makes 10 basics to fix (although some as just issues that make the tool look unpolished), however, it does seem as though testing in the following areas could be significantly better:
    1) Regression testing - a number of bugs seem to crop up again after being fixed in earlier versions
    2) Navigator/object tab queries - especially with multi-schema applications (ie Oracle eBusiness Suite) and just generally objects owned by other schemas
    3) Performance with large DBs in terms of object count (ie Oracle eBusiness Suite)
    As a final note, it is my impression that SQL Developer development has been unbalanced in focusing too much on including new functionality (which is good) and not enough on getting existing functionality right (which is better).
    I hope this helps (and wasn't too long) ...
    theFurryOne

  • Calling a Breadcrumb image inside a Table view column

    Hi
    I want a sample code to call any bread crumb related image inside a table view column.
    Please help with a code snippet.

    I mean that, inside the iterator class of the tableView, write this code in the RENDER_CELL_START method.
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
      CASE p_column_key.
        WHEN 'ICON'.
    p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(       id        = p_cell_id                              src      = '@3J@'  ).
        ENDCASE.
    Inside the method, GET_COLUMN_DEFINITIONS you need to append a column for icon, see the code below:
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
        <def>-COLUMNNAME = 'ICON'.
        <def>-TITLE      = 'Display Icon'.
    For more info you can refer to weblog on HTMLB TableView Iterator by Brian.
    Hope I am clear.
    Regards,
    Ravikiran.C

  • Column Datatype modify

    Hi,
    How can i modify a column datatype varchar2(100) into blob in a table.
    Regards,
    Fame

    create table x (y varchar2(100));
    insert into x values ('A');
    commit;
    alter table x rename column y to z;
    alter table x add (y clob);
    update x set y = z;
    commit;
    alter table x drop column z;
    Table dropped.
    Table created.
    1 row created.
    Commit complete.
    Table altered.
    Table altered.
    1 row updated.
    Commit complete.
    Table altered.
    drop table x purge;
    create table x (y varchar2(10));
    insert into x values ('A');
    commit;
    alter table x rename column y to z;
    alter table x add (y blob);
    update x set y = utl_raw.cast_to_raw (z);
    commit;
    select * from x;
    update x set y = (z);
    commit;
    select * from x;
    alter table x drop column z;
    Table dropped.
    Table created.
    1 row created.
    Commit complete.
    Table altered.
    Table altered.
    1 row updated.
    Commit complete.
    Z          Y
    A          A
    1 row selected.
    1 row updated.
    Commit complete.
    Z          Y
    A          
    1 row selected.
    Table altered.

  • Need to know base table and base column name for Oracle view columns

    I am trying to load metadata for some views and that requires me to know what the final table and column name would be corresponding to the view column.
    For example, if I have a view x_v that is select a,b from x_v2; and x_v2 is a view that is select a,b,c from x;
    I need to get the following information.
    View View Col Base Table Base Col
    X_V A X A
    X_V B X B
    and so on.
    Is it possible to get this programmatically using any SYS schema tables or Dependency tables?
    I tried an indirect approach wherein I lock tables using LOCK TABLE or FOR UPDATE OF. But I'm not too sure if I can go down to the level of individual view columns.
    Can you help me with this?

    Thanks. I was looking at some indirect approaches.
    I came up with this script that does it faster than dependencies but thats just for tables and not column mapping.
    declare
    cursor bt(cp_sid number) is
    select u.name uname, o.name oname
    from sys.obj$ o, sys.user$ u
    where o.obj# in (select id1
    from v$lock
    where sid=cp_sid)
    and u.user# =o.owner#;
    cursor c_sid is
    select sid
    from v$session
    where audsid =userenv('sessionid');
    l_sid number;
    l_view varchar2(100):= 'PER_PEOPLE_V';
    l_schema varchar2(10):= 'APPS';
    begin
    open c_sid;
    fetch c_sid into l_sid;
    close c_sid;
    dbms_output.put_line('SID: '||l_sid);
    execute immediate 'lock table '||l_schema||'.'||l_view||' in row share mode nowait';
    for i in bt(l_sid) loop
    dbms_output.put_line(i.uname||'.'||i.oname);
    execute immediate 'alter table '||i.uname||'.'||i.oname||' disable table lock';
    execute immediate 'alter table '||i.uname||'.'||i.oname||' enable table lock';
    end loop;
    end;
    It basically uses locks on views to verify locks on the base tables.
    Just wondering, can we use FOR UPDATE OF statements to get to the columns?

  • Where is the refresh tab under the view column that use to be there?

    Up until FF 4.0 was installed, I use to be able to click on the refresh tab in the view column and refresh the current page. Not anymore. What happened to it and how to I access that feature?

    I finally found the button. Nevermind.

  • Mavericks Will Not Retain Finder List-View Column Resizing

    I've noticed this to occur at the root level of my hard disk in Finder.  A visual will work best:
    The "User Guides and Information" folder is truncated at the root level of my Hard Disk.  I will then manually resize the column:
    When I close out this window via the red close circle, and re-open, Finder will not remember my custom column view.  It will revert back to the previously truncated state.
    Oddly enough, I've found Finder to correctly preserve custom list view columns when you drill down a level (such as my custom column views inside of my Applications folder, for example).

    I managed to find a solution that sorts the problem out for the time being till maybe Apple rectifies it.  It is to open Finder and have it expanded to fit the screen.  I don't know the proper names of things but in the heading that says Name etc, right click that so that you get a list of other things that can go in that heading, like Date Modified, Date Created etc.
    Tick one or two that you don't need, like Tags for example.  The purpose of those extra headings are to fill the column space at the right hand side of Finder so that it keeps the columns that you DO want on the left hand side kept in the same place.  Once you've got all the headings and columns, move the width of the ones you want to the size that you want, making sure that the ones that you don't want, like Tags, on the right hand side totally fills up the rest of the column space.
    This makes the full page Finder column space full up so that the columns you want don't end up shrinking every time you open Finder.  Return Finder to the size that you usually use, adjust the width of your wanted columns to the size that you want and it should stay in place because the rest of the space in Finder is filled with the unwanted columns you chose, but which are hidden from view on the far right hand side of Finder, if you've got Finder smaller than the full screen, that is.
    Ever since I did this with my columns (in List view) my columns remain where I have set them.  (I hope you understand all that OK).

  • SEM-CPM Analysis view columns

    Hello, I know this is a question on an old product but...
    In balancd scorecards, i have 2 scorecards that look like they have been set up in the same way however when I present them in analysis view the views are very different.
    One has al the information regarding trend, owner etc... the other just shows the hierarchy of strategy/perspective/objective/mesure
    where is the setting where I can decide what to show on the analysis view columns?  I have looked into scorecard specific design and there are no differences in the setup!
    please help..
    thanks

    I have the same problem, i wat to setup the columns that can be viewed (current, plan, target) for the analysis view of the scorecard, but i cannot find where to set up this.
    Could you please help me in order to set up the "Analysis view" in my scorecard.
    Regards,
    Thanks in advance
    Carlos España.

  • OBIEE - changing imported column datatypes

    Hi All,
    I am trying to join 2 tables in physical layer but the columns on which I am making join condition have different datatypes defined(one is datetime,another is timestamp).Hence, I am getting error incompatible datatypes can't be joined.
    I don't want to change the columns datatypes in ohysical layer bcz I am not sure if some other report using this rpd might be using the join conditions based on existing datatypes.Is there any alternative to this?
    Please suggest.
    Thanks,
    Neha

    Please try to use this function. it is good if we have sample data for both columns.Please provide if you have issues using following function
    Evaluate( 'to_date(%1,%2)',Evaluate( 'TO_CHAR(%1)' as char,20090101) , 'yyyymmdd')
    Thanks
    NK

  • "Views" column works only if excluding its posters

    "Views" column is a good idea, thanks,
    (and finally we would not need a "Read vs Unread" column if only the small blue dots were not SO small)
    but
    it would be nice if it showed the actual number of visits.
    As it is now, it mainly shows how many times the posters edit their questions and answers, and how many times they go check if they were awarded
    Why not set it to ignore its posters' views, and count only the views by people who have no post in it?
    Thanks for the hard work!
    Things are getting better now and I already like the new Discussions!
    Axl

    Testing again: Marking (back) the question as Unanswered.
    "You must enter a reason for marking your question as unanswered because it is currently marked as "answered."
    Sorry ~Bee, I'd rather leave it like that, than mark an Unanswered question as Answered.
    Edit:
    Of course this too adds a new post, as if it was a reply or additional useful info.
    So this has to be my Post #314/2760

Maybe you are looking for

  • Guranteed messaging and auto acknowledgement

    I have a webservice sending messages to a Topic on the WL server instance. The webservice recieves XML messages from an external system. The mesage after being recieved is send to the different consumers. How willl I implement auto message reciept ac

  • Basic Spatial Query

    Hi guys, I am currently developing a java applet to display telecommunication sites taken from an Oracle 8.1.6 DB. The company I work for also happens to have the spatial cartridge which I intend to use to overlay a country map over my plottings. I h

  • Use JNI to Read C++ Structure from a Socket

    Hi all, I'm new to JNI and I have a problem for reading a tcp stream from a C++ server in my Java client. Does someone now if it's possible to use JNI to "cast" my tcp stream (array of byte) in a java structure (class of data) ? I've heard about Stru

  • How to get UIGraph as image ?

    Hi, I bind my chart component to managed bean. It's represented as oracle.adf.view.faces.bi.component.graph.UIGraph class. I need programmaticaly get it as gif or jpeg. How to do it ? Kuba

  • Adobe Reader/Flash issue

    I'm trying to open a pdf created by Mindjet MindManager 15, and a message appears telling me to download the required version of Flash. I have and I still keep getting the same message. Can someone tell me how to cure the problem please?