Column sizes in views

Hopefully someone can help.
When I look at a concatenated view, the column sizes of the view are much larger than when I run a describe of the view. Does anyone know why ?
in sqlplus or sql editior in sql developer
desc t1
SOURCE_ID NOT NULL VARCHAR2(16 CHAR)
PRODUCT_ID NOT NULL VARCHAR2(6 CHAR)
DESCRIPTION VARCHAR2(30 CHAR)
AS_AT_DATE DATE
desc t2
Name Null Type
SOURCE_ID VARCHAR2(16 CHAR)
LB_LOGO VARCHAR2(6 CHAR)
LB_DESCRIPTION VARCHAR2(30 CHAR)
AS_AT_DATE DATE
The view looks like:
CREATE OR REPLACE FORCE VIEW v1 (source_id, product_id, description, as_at_date )
AS
SELECT source_id, product_id, description, as_at_date
FROM t1
UNION
SELECT source_id, lb_logo, lb_description, as_at_date
FROM t2;
In sql developer the columns of v1 is defined as:
PRODUCT_ID     VARCHAR2(24)     Yes          2
DESCRIPTION     VARCHAR2(120)     Yes          3
AS_AT_DATE     DATE     Yes          4
SOURCE_ID     VARCHAR2(64)     Yes          1
In sqlplus or sqldeveloper,
desc v1
Name Null Type
SOURCE_ID VARCHAR2(16 CHAR)
PRODUCT_ID VARCHAR2(6 CHAR)
DESCRIPTION VARCHAR2(30 CHAR)
AS_AT_DATE DATE
Does anyone have any ideas ?

Hopefully someone can help.
When I look at a concatenated view, the column sizes of the view are much larger than when I run a describe of the view. Does anyone know why ?
in sqlplus or sql editior in sql developer
desc t1
SOURCE_ID NOT NULL VARCHAR2(16 CHAR)
PRODUCT_ID NOT NULL VARCHAR2(6 CHAR)
DESCRIPTION VARCHAR2(30 CHAR)
AS_AT_DATE DATE
desc t2
Name Null Type
SOURCE_ID VARCHAR2(16 CHAR)
LB_LOGO VARCHAR2(6 CHAR)
LB_DESCRIPTION VARCHAR2(30 CHAR)
AS_AT_DATE DATE
The view looks like:
CREATE OR REPLACE FORCE VIEW v1 (source_id, product_id, description, as_at_date )
AS
SELECT source_id, product_id, description, as_at_date
FROM t1
UNION
SELECT source_id, lb_logo, lb_description, as_at_date
FROM t2;
In sql developer the columns of v1 is defined as:
PRODUCT_ID     VARCHAR2(24)     Yes          2
DESCRIPTION     VARCHAR2(120)     Yes          3
AS_AT_DATE     DATE     Yes          4
SOURCE_ID     VARCHAR2(64)     Yes          1
In sqlplus or sqldeveloper,
desc v1
Name Null Type
SOURCE_ID VARCHAR2(16 CHAR)
PRODUCT_ID VARCHAR2(6 CHAR)
DESCRIPTION VARCHAR2(30 CHAR)
AS_AT_DATE DATE
Does anyone have any ideas ?

Similar Messages

  • Create materialized view with specific column sizes

    Hi all,
    I'm trying to create a materialized view with a specific a column size. Something like
    create materialized view test_mv
    refresh force on demand
    as
    select id,
           cast(my_compound_field as nvarchar2(50))
    from ( select id,
                  field1 || field2 my_compound_field
           from   my_table);But Oracle seems to ignore the cast and takes the maximum size it finds for field1 || field2 in the select query. The resulting table has a column nvarchar2(44) instead of nvarchar2(50).
    This can give a problem when the view is refreshed... there could be new data that exceeds the current size, i.e. where length(field1 || field2) > 44.
    How can I override the column size of a field in a materialized view?
    Edit: Some additional info to clarify my case:
    field1 and field2 are defined as nvarchar2(25). field1 || field2 can theoretically have a length of 50, but there is currently no data in my table that results in that length, the max is 44. I am afraid that there will be data in the future that exceeds 44, resulting in an error when the MV is refreshed!
    Edited by: Pleiadian on Jan 25, 2011 2:06 PM

    Cannot reproduce what you are saying is happening.
    SQL> create table t (a nvarchar2(50), b nvarchar2(50));
    Table created.
    SQL> create materialized view tmv as
      2  select a, b, a || b c from t;
    Materialized view created.
    SQL> desc tmv
    Name                                      Null?    Type
    A                                                  NVARCHAR2(50)
    B                                                  NVARCHAR2(50)
    C                                                  NVARCHAR2(100)
    SQL> drop materialized view tmv;
    Materialized view dropped.
    SQL> create materialized view tmv as
      2  select a, b, substr(a || b, 1, 10) c from t;
    Materialized view created.
    SQL> desc tmv
    Name                                      Null?    Type
    A                                                  NVARCHAR2(50)
    B                                                  NVARCHAR2(50)
    C                                                  NVARCHAR2(10)
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL>Edited by: 3360 on Jan 25, 2011 8:10 AM
    And with data
    SQL> insert into t values ('3123423423143hhshgvcdcvw', 'ydgeew  gdfwe   dfefde  wfjjjjjjj');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> desc tmv
    Name                                      Null?    Type
    A                                                  NVARCHAR2(50)
    B                                                  NVARCHAR2(50)
    C                                                  NVARCHAR2(10)
    SQL> select * from tmv;
    A
    B                                                  C
    3123423423143hhshgvcdcvw
    ydgeew  gdfwe   dfefde  wfjjjjjjj                      3123423423

  • How to increase the column size of Alv tbale

    Hi All,
    I created an Alv table to display the content of my database table. In one of the column the entire data from my database are not displayed the last few characters are missing. The data type for that column in the database is char. Can any one help me how to increase the column size in my Alv table or any suggestions to resolve this issue.

    Hi Vadiv,
    Try with this..
    DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
    LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
    LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
    LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
    LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
    IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
    LR_CMP_USAGE->CREATE_COMPONENT( ).
    ENDIF.
    " get reference to the ALV model
    LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
    LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
    LR_TABLE_SETTING ?= LR_CMDL.
    " Set column width
    DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
    LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
    LR_COL->SET_WIDTH( '70' ) .
    LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).
    LR_COL->SET_WIDTH( '100' ) .
    LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
    You can refer to webdynpro component SALV_WD_TEST_TABLE_PROPS. Go to the view TABLE and look inside the method SET_COLUMN_SETTINGS. I hope this will help you.
    Cheers,
    Kris.

  • SQL-developer 4 EA unable to change the column sizes

    when viewing data, it is not possible to change the column sizes like you do in a spreadsheet by sliding between the column-headers.
    regards Karsten

    when viewing data, it is not possible to change the column sizes like you do in a spreadsheet by sliding between the column-headers.
    regards Karsten

  • Changing column size

    Hi
    I am working on oracle 8i. I have requirement to change a column size from varchar(3) to varchar2(4). I know the command to change the column size. all I need to know, their are 6 child tables. they are referencing this tables column.
    what is the best way do I need to change child tables column size first and then i need to change column sixe of main table. do i need to consider to change views and triggers ans indexex.
    please help me

    Hello,
    You would increase dramatically your chances to get an answer by posting in the Database forum.
    Francois

  • Reg : Column Size -

    Hi All,
    I've got a doubt regarding alter the column size.
    There's a table column which is currently 255 and I want to increase it to max i.e. 4000 Char
    It is used in many places by various objects - Procs/Packages/Triggers/Views...
    Is it advisable to use Varchar2(4000Char) or using LONG or CLOBS??
    If I use LONG/CLOB now, will it affect the existing objects since they believe the column to be VARCHAR2...?
    Help highly appreciated.
    My Database :
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE     10.2.0.3.0     Production
    TNS for Solaris: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - ProductionThanks in Advance,
    Ranit B.

    ranit B wrote:
    Hi All,
    I've got a doubt regarding alter the column size.
    There's a table column which is currently 255 and I want to increase it to max i.e. 4000 CharBe aware, the Maximum is 4000 bytes not char. If your database is using a multi byte character set, the maximum could actually be as small as 1000 characters (if you have 4 bytes per character).
    It is used in many places by various objects - Procs/Packages/Triggers/Views...
    Is it advisable to use Varchar2(4000Char) or using LONG or CLOBS??Never use LONG. the LONG datatype was deprecated over a decade ago. If you're needing to store large amounts of text, use CLOB.
    If I use LONG/CLOB now, will it affect the existing objects since they believe the column to be VARCHAR2...?It's one of those "it depends" answers, because it depends what the code is doing with it. It's not so much a case of the code/objects believing it to be varchar2, but whether that code or objects can do implicit conversions without issue. If it's just a case of something inserting into it, believing it's a varchar2, then it would work ok e.g.
    SQL> create table mytable (x clob);
    Table created.
    SQL> insert into mytable (x) values ('This is my varchar string');
    1 row created.The problem would obviously be if there is code that is reading the data into a varchar2 variable or datatype and the data exceeds the 4000 byte limit, in which case you will get issues.
    The best way to look at is is... Yes, it will effect existing code/objects, and you need to carry out an impact analysis to see where and how it's used.

  • Problem with binding value on the UI  from a calculated column in the view

    I have calculated field "Readiness" in my db view, which gets calculated based on other columns in the same table. I have added new column to my EO using "Add from table" option and added the same column from to VO using "Add from EO" option. In my application, I will update a particular date field in the UI and this calculated column "Readiness" in the db will be set to yes or no and this logic is working fine, both date date field and calculated field are in same view object. I have added a attribute binding to this "Readiness" column in my view page. The problem is the calculated column value does not reflect the new value in the db, it shows the old value. I have tried different refresh option for the iterator and ppr option for the field binding. Even after reloading the page, the value shown on the UI page is different from the value in db, other bindings on the UI page works fine, not sure any special settings are required for the Calculated columns. any ideas are appreciated.
    Thanks for your help,
    Surya

    I tried to add soms debugging statements in the EO and getters method, the calcaulated column is not picking the value in db view. I'm not any special iterator/field settings are required at BC level. I'm a newbie, any help is appreciated.
    Thanks,
    Surya

  • How to cast a column of a derived column in a view to NULL

    I have a derived column in my view and this column by default is picked up as not null.
    I want to cast it to null how can i do it ?
    Actual column
    column1 varchar(3) not null
    Expected column
    column1 varchar(3)  null
    Mudassar

    Shridar I  havent defined it but the derived column has been picked up as not null which is strange
    CREATE VIEW test
    AS
    SELECT 
    CASE
    WHEN COMPANY_SIZE IS NULL then  'a'
    ELSE 'b' 
    END AS
    column1 ----- added derived column identifier
    ,[Company_Size] AS [CompanySize]
    FROM xyz
    Mudassar

  • Report Generation excel column size

      Dear,
    In the project, I save the data in Excel with Report Generation. I would like change just the column size of my Excel report. There is an explanation in the labview help but I have always an error when I run the VI.
    I work with labview 8.2
    A VI is joined with a simple example.
    Regard
    Julien
    Attachments:
    report table graph.vi ‏21 KB

    Julien,
    I realize you only want to modify columns, but you need to put in a start and stop row value other than -1.  Try setting the start and stop rows to 0.

  • Column definition for a specific column in a view

    Is there a way to query the metadata to get the definition of a single column in a view? I can see the complete DDL for a view from USER_VIEWS.TEXT, and I can see the column listing in USER_TAB_COLUMNS to give the datatype etc. However, what I'm looking for is the DDL that defined a specific column.
    So, given:
    create table PERSON (
    SSN VARCHAR2(12),
    FIRST_NAME VARCHAR2(25),
    LAST_NAME VARCHAR2(25),
    STREET VARCHAR2(40),
    CITY VARCHAR2(30),
    STATE VARCHAR2(30),
    ZIP VARCHAR2(15),
    COUNTRY VARCHAR2(35))
    create view PERSON_VW as
    select SSN,
    FIRST_NAME,
    LAST_NAME,
    FIRST_NAME || ' ' || LAST_NAME FULL_NAME
    from PERSON
    I expect the query might look something like:
    select DDL from metadata where table_name = 'PERSON_VW' and column_name = 'FULL_NAME'
    and the result would be: "PERSON.FIRST_NAME || ' ' || PERSON.LAST_NAME"
    or select DDL from metadata where table_name = 'PERSON_VW' and column_name = 'FIRST_NAME'
    and the result would be: "PERSON.FIRST_NAME"
    Thanks!

    >
    Hi again Barry,
    When I queried user_tab_columns (or dba_tab_columns or all_tab_columns), I have the following list of columns:
    TABLE_NAME
    COLUMN_NAME
    DATA_TYPE
    DATA_LENGTH
    DATA_PRECISION
    DATA_SCALE
    NULLABLE
    COLUMN_ID
    DEFAULT_LENGTH
    DATA_DEFAULT
    I don't see anything resembling the DDL for the view column. Somewhere underneath some
    cover I haven't peeked under, Oracle must be keeping track of what it is supposed to be giving
    for, in my example, FULL_NAME.Unless I'm very much mistaken, these columns' data (per table) looks pretty much like DDL to me.
    Maybe what you need is just SQL Developer (great tool, if you don't have it, get it!).
    And it's free (as in beer - not as in speech! :( )
    Beside the connections tab is a "Reports" tab with various, as you might expect ;), reports.
    One of them is on the Tables - with (some) DDL. This will work as a once-off if that's what
    you need?
    Otherwise there's the SQL tab if you open a table under connections - it's very complete - sample
    at bottom of post.
    HTH,
    Paul...
    (Ultimately, I'm diagnosing problems in existing databases that have views already created so
    I don't have the option of considering virtual columns.)Quelle surprise ;(
    Paul...
    -Barry
    CREATE TABLE "HR"."COUNTRIES"
        "COUNTRY_ID"   CHAR(2 BYTE) CONSTRAINT "COUNTRY_ID_NN" NOT NULL ENABLE,
        "COUNTRY_NAME" VARCHAR2(40 BYTE),
        "REGION_ID"    NUMBER,
        CONSTRAINT "COUNTRY_C_ID_PK" PRIMARY KEY ("COUNTRY_ID") ENABLE,
        CONSTRAINT "COUNTR_REG_FK" FOREIGN KEY ("REGION_ID") REFERENCES "HR"."REGIONS" ("REGION_ID") ENABLE
      ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255 LOGGING STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "USERS" PCTTHRESHOLD 50;
    COMMENT ON COLUMN "HR"."COUNTRIES"."COUNTRY_ID"
    IS
      'Primary key of countries table.';
      COMMENT ON COLUMN "HR"."COUNTRIES"."COUNTRY_NAME"
    IS
      'Country name';
      COMMENT ON COLUMN "HR"."COUNTRIES"."REGION_ID"
    IS
      'Region ID for the country. Foreign key to region_id column in the departments table.';
      COMMENT ON TABLE "HR"."COUNTRIES"
    IS
      'country table. Contains 25 rows. References with locations table.';

  • How can I add a new column to Grid view under Tests tab

    I understand in "ORACLE Test manager for web Applications", the Grid view under Tests tab should be customised.
    How can I add a new column to Grid view under Tests tab? Thanks Katherine

    I don't think this is possible.
    Regards,
    Jamie

  • How to change font size, maximum column size in the result screen ?

    hi All
    That's great when using SQL Dev.
    But I also have a trouble that how to change font size, maximum column size in the result screen ?
    My users think that font in result screen is shown very small, and whenever the data in each colum is long then it's not shown full data in column, they must double click for extend the size. Have the option to default the max size for showing full data in each column ? I try but still not to do that .
    Appreciate for anyone to help us.
    Thanks all.
    Sigmasvn

    You can't change the font for the results screen yet, however you will be able to select an auto-fit option for selected columns, so if some columns have slitghtly wider text you'll be able to set the column widths to handle these wider columns.
    Also, there s the option of switching the layout of a record in the grid.
    Sue

  • Just bought new iMac. When browsing in Safari, sometimes the text suddenly gets super large. I'm doing nothing except reading the screen, tho I have my hand on the mouse. I can get back to normal size by clicking "actual size" in View. What gives?

    Just bought brand new new iMac. When browsing in Safari, sometimes the text suddenly gets super large. I'm doing nothing except reading the screen, tho I usually have my hand resting lightly on the mouse. I can get back to normal size by clicking "actual size" in View. But then it does it again a minute or two later. What gives? Something seems defective--but what?

    From System Preferences, Mouse, Point & Click, Secondary click.  Go to it hover over Secondary click and watch the short video sequence change it left right, left right, you will see exactly what is does. No I do not think your Mouse is defective, you simply need to take control of your Mouse finger.

  • Times missing in left column in week view

    I am using iCal 2.0.3 and the hour times to not show in the left column in week view. Noon is present, but no others. There have been a few occasions that times have shown up, but then the next time they are gone. I set up a new user and went into iCal and the dates show. All my prefs are the same in my account and the "new user".
    I am suspecting that there is corrupted prefs file of some sort, but I am reluctant to just delete files without knowing which one. Since I installed 10.4 a few months ago, I have found a lot of settings changed that upgrades should have kept intact in preferences.
    Any suggestions?

    no responses
    posting again

  • Custom column in List view

    Dear guru's,
    I'd like to ask you if its possible to add custom column in list view. For example in tc. FBL1N I'd like to add a column with custom text (for example with value "1" for counting the sum of rows). Is it possible to do without creating custom program?
    Thank you all.
    Regards.
    Michael.

    Hi Michael,
    It's not possible to add some extra text in standard out-put without modifying it or creating custom program.
    For adding a column in your list view. I think this write statement will help you
    WRITE 'You can overwrite the following line:'.
    FORMAT INPUT ON INTENSIFIED OFF.
    WRITE 'WRITE HERE'.
    FORMAT INPUT OFF INTENSIFIED ON.

Maybe you are looking for