2nd Max column length

I have a question to find the length of a column in a table as below
where col1 is type varchar2 column

SELECT max (length (col1)) from table1

I would find the second length column col1 max. Pls let me know how it can be determined

Thank you

Or with a single nested query...

SQL> ed
Wrote file afiedt.buf

  1  select ln
  2  from (
  3        select row_number() over (order by length(job) desc) as rn, length(job) as ln
  4        from emp
  5        group by length(job)
  6       )
  7* where rn = 2
SQL> /

        LN
----------
         8

Tags: Database

Similar Questions

  • How to increase the limit the max column pivot in BIEE 11 G?

    Hi Experts,

    How to increase the limit the max column pivot in BIEE 11 G?

    When the number of columns exceeds 256 in pivot mode, it generates the error message as below:

    Exceeded the configured maximum number of allowed output prompts, sections, the rows or columns.
    Error details
    Error codes: IRVLJWTA:OI2DL65P
    Geographical area: saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    Publ. SQL: 13678 ~ vid1ptgt0v5ubh39gesnauuhl6

    For example:
    ----------------Day
    Country - 20120101 - 20120102-... 20121231
    China - 10000 - 20000-...

    Try increasing the lines Max Instanceconfig.xml

    Path:-Middleware\instances\instance1\bifoundation\OracleBIPresentationServices\instanceconfig. XML




    300
    1000
    500
    25
    30


    Try to add in the configuration file and restart the services.

    Mark as correct if it is useful.

    Thank you.

  • Compare the min and max columns

    Hello

    I want to compare colum 1,2,5

    If max - min > 1 = failure

    How could I go making the?

    I think I should just remove all columns with 0, but I'm having a hard time to remove.

    can someone guide me how do.

    Thank you


  • Error in the OPA due to the max min length

    Hello
    I have an attribute of type number and min and max length as -2147483648 'and ' 2147483647'.
    The value of this attribute is defined in the onBeforeSubmit handler in fetching its data value. However, on the screen it's show me error "this value is of the wrong type. Even if I put the correct value (in the range-2147483648 'and ' 2147483647'.) it is showing me the same error.


    No idea why it gives me error.

    Thank you
    Fox

    Published by: PR on November 16, 2012 23:29

    Try:

    setGlobalInstanceAttribValue(iUserDataObj, "BR2_SettlementLimit", rs.getDouble("LIMIT"));
    

    (This assumes that the value given here is the value that is the cause of the problem)

  • How can I increase the max message length?

    Tried to send an approx. 300 Mbps video via Thunderbird, but got the message that themail exceeded the length of 2000000.

    300 Mbps? Or maybe even 300 MB? By e-mail?

    Are you serious?

    Many e-mail servers have limits such as 10 or 20 MB per message. Some users do not even have 300 MB mailboxes.

    What is the exact wording of the message? I think it's a server, not Thunderbird.

    Do you have Thunderbird not invite you to use the box or similar? Have you tried dropbox or YouSendIt services type?

  • Add a 2nd visible column to list

    Hey all,.

    I try to display two columns of data in the same list, but it seems that the list will only show something under the "wording" field  I tried to set my columns implicitly (setting the width of the list to 100, then the columnWidth to 50) and then a tag my items in the dataProvider, "col1", "col2".  But no luck.

    Anyone have any ideas?

    Thank you!

    The List class doesn't have a sense of columns like a DataGrid component can. What you can do to get your desired result is to create a custom CellRenderer class and use it in your list. This will give you the possibility of your columns based on specific data layout.

    Here's what might look like your custom CellRenderer class.

    package
    {
        import flash.text.TextField;
        public class ColumnCellRenderer extends CellRenderer
        {
    
            private var column1:TextField;
            private var column2:TextField;
    
            public function ColumnCellRenderer()
            {
                super();
            }
    
            override protected function init():void
            {
                column1 = new TextField();
                column1.width = 100;
                addChild( column1 );
    
                column2 = new TextField();
                column2.width = 100;
                column2.x = 110;
    
                addChild( column2 );
    
                super.init();
            }
    
            override public function set data( data:Object ):void
            {
                super.data = data;
    
                column1.text = data.col1;
                column2.text = data.col2;
            }
    
        }
    }
    

    Then you might say your list to use the rendering engine of cell with the List.setSkin () method.

  • Automatic vertical column length

    I think that I messed up somewhere today, but don't know what. Here are two link is updated my home page and other that I have not yet downloaded, so always the same.

    Hepato-Biliary liver, pancreatic cancer, surgery in General by the best surgeon, Winston Salem, NC - the vertical column down completely down who they were until I uploaded these images in the left column and I replaced the former which is in this link.

    On Forsyth Surgical Associates-Winston Salem North Carolina - this page left and right columns go all the way down. I don't know what happened after the download of the images and trying to manipulate those that now my two columns are attached in the middle.

    The only thing I've tried to do is to put a ' play' button over these videos in the left column or another image on top of these images that would say that patient testimonials.

    Any help... to solve the problem of height of column and put a button "play" over these videos

    Thank you very much.

    In CSS there is no such thing as equal height columns true.  The best you can do is to create the illusion of columns of the same height with some creative CSS or JavaScript.  Here are some examples:

    ALT-Web: same height CSS columns

    Nancy O.

  • ORA-06502 when you use MAX (Column) with % TYPE

    Hello

    I tried to limit the problem as much as I can and have managed to isolate a particular scenario. As the structure and sensitive data, I had to come up with a scenario that I tested it and it causes the same problem occurs. The scenario is as follows

    Assuming that I have a table defined as follows

    CREATE TABLE TEST_TABLE (TEST_COLUMN CHAR (8 BYTES));

    and the table has only one record NZ07100S

    We also define a function as

    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    TEST_TABLE RETURN. TYPE % TEST_COLUMN
    IS
    TEST_VALUE TEST_TABLE. TYPE % TEST_COLUMN;
    BEGIN
    SELECT MAX (TEST_COLUMN) IN TEST_VALUE TEST_TABLE;
    RETURN TEST_VALUE;
    END;



    We ran the following command

    SELECT GETTESTVALUE FROM DUAL;

    and receive an error as follows

    Error report:
    SQL error: ORA-06502: PL/SQL: digital or value error: character string buffer too small
    ORA-06512: at "GETTESTVALUE", line 6
    06502 00000 - "PL/SQL: digital error or the value of %s.


    However, if were to change the function of the following

    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    TEST_TABLE RETURN. TYPE % TEST_COLUMN
    IS
    TEST_VALUE TEST_TABLE. TYPE % TEST_COLUMN;
    BEGIN
    SELECT TEST_COLUMN IN TEST_VALUE TEST_TABLE;
    RETURN TEST_VALUE;
    END;

    There is no error reported and the value nz07100s is returned.

    Of course, when we changed the function is

    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    TEST_TABLE RETURN. TYPE % TEST_COLUMN
    IS
    TEST_VALUE TEST_TABLE. TYPE % TEST_COLUMN;
    BEGIN
    SELECT CAST (MAX (TEST_COLUMN) AS CHAR (8)) IN TEST_VALUE TEST_TABLE;
    RETURN TEST_VALUE;
    END;

    No error is reported, and the value is returned

    However, the function in question is in the use of production since 2004. We are currently a few changes to the application and imported the backup of Oracle 10 g Oracle XE. When we try to run the function, the error is thrown.

    I would like to understand if this is a limitation with Oracle XE that causes this problem. It seems to me that the problem is to select the MAX value in the variable that has been set. Executing the query directly from sqlplus does not generate an error, and therefore do not feel there is an error with the SQL code. The only time that we can't get the error is with the INTO statement.

    Is there a way to use the function as it has been defined in production? Why the ORA-06502 error would be thrown? It does not seem to make sense to me. Would appreciate any guidance on this.


    Thanks and greetings

    Jega

    Thank you

    What happens if you do this and rerun the select

    SQL>alter table test_table modify test_column varchar2 (8 byte);
    

    Edit:
    You may need to open a SR with Oracle on this one
    (Really, financial system on XE?)

    Concerning
    Peter

    Published by: Peter on March 4, 2009 12:58 AM

  • get the only the lines that the max column

    Hello

    This is my entry
    2     x1     18/03/2003         59,4
    2     x1     03/04/2003         55
    2     x1     01/01/2002             51,65
    33     y1     22/08/2005        44
    61     z1     22/08/2005          55
    61     z1     01/01/2008        55
    64     z2     16/01/2004       44
    64     z2     22/08/2005       44 
    
    How can I do to get only the rows having the max data_iv, that is: 
    
    2     x1     03/04/2003          55
    33     y1     22/08/2005        44
    61     z1     01/01/2008        55
    64     z2     22/08/2005       44 
    Thanks in advance for any help

    You can use the analytical functions with a view online, for example

    SELECT   *
    FROM     (
                SELECT   col1
                ,        col2
                ,        col3
                ,        col4
                ,        RANK() OVER (PARTITION BY col1 ORDER BY col3 DESC) ranking
                FROM     table
             )
    WHERE    ranking = 1
    
  • Divide a table of lines of fixed length column.

    Hi Experts,

    I need a help on the splitting of a column values for several lines by a fixed length. The value of column length is variable. I want to split by a fixed length and create a separate from that.

    for example, my table is like

    ID Desc

    ============

    1 ABCDEFGHIJKLMNOP

    2 QRSTUVW

    3 XYZ

    My desire to output should be like BY SPLIT WITH 5 characters long

    ID Desc SEQ

    ===============

    ABCDE 1 1

    1 SON 2

    1 KLMNO 3

    1   P              4

    QRSTU 2 1

    2 2 VW

    3 XYZ 1

    Thank you

    This will do...

    SQL > ed
    A written file afiedt.buf

    1 with t (id, dsc) until)
    2. Select 1, "ABCDEFGHIJKLMNOP" dual union all
    3. Select 2, 'QRSTUVW' from dual union all
    4. Select 3, 'XYZ' from dual
    5        )
    6  --
    7. end of test data
    8  --
    9. select id, level, substr (dsc, ((level-1) * 5) + 1, 5) as dsc
    10 t
    11 connection by prior id = id
    12 and substr (dsc, ((level-1) * 5) + 1, 5) is not null
    13 * and prior sys_guid() is not null
    SQL > /.
    ID LEVEL DSC
    ---------- ---------- -----
    1 1 ABCDE
    1 SON 2
    1 3 KLMNO
    1 4 P
    2 1 QRSTU
    2 2 VW
    3 1 XYZ

    7 selected lines.

    Note: it is not a good idea to use 'desc' as a column name, as it is a reserved, Word used to describe the table definitions.

  • Confusion of length of column data type

    Hi all

    To learn about my column data type and length, I have run the following query. However, when I confirm it with the table_name desc command, I see that the lengths of data do not correspond. You have an idea?

    > > select column_name | » '|| DATA_TYPE | » ('|| ( data_length|') ' col_info all_tab_columns where table_name = 'CUSTTABLE' and column_name = 'ACCOUNTNUM;

    > > ACCOUNTNUM NVARCHAR2 (24)

    > > desc CUSTTABLE.

    > > ACCOUNTNUM 1 N NVARCHAR2 (12)

    Concerning

    Charlie

    NightWing wrote:

    By the way I couln t understand what were you thinking when you explain to no.

    I missed you NVARCHAR2 column and thought it was VARCHAR2. When you declare the semantics of VARCHAR2 column length is specified explicitly or implicitly. Explicitly suffixing length with BYTE or CHAR and implicitly when you specify the length of the right itself. Then length is based on the value NLS_LENGTH_SEMANTICS session. So let's assume you generate table create statement (and it seems that you is, based on column_name |) » '|| DATA_TYPE | » ('|| ( data_length|') ' ). Then it does not matter if use use data_length or char_col_decl_length. It will be regadless semantics implied length of what you use. Therefore, when you run create table instructions column length will be interpreted as bytes if current NLS_LENGTH_SEMANTICS byte value. But same length is interpreted as the characters if current NLS_LENGTH_SEMANTICS a char value. As you can see, in order to generate create table statement we use explicit semantic length column, otherwise create table statement can produce lengths of different column in the source table.

    SY.

  • Change the length of a Table column (CHAR data type)

    Hi gurus,

    SQL > select * from version $ v

    BANNER

    ----------------------------------------------------------------

    Oracle Database 10g Release 10.2.0.3.0 - 64 bit Production

    PL/SQL version 10.2.0.3.0 - Production

    CORE Production 10.2.0.3.0

    AMT for Linux: release 10.2.0.3.0 - Production

    NLSRTL Version 10.2.0.3.0 - Production

    I need to increase the length of a CHAR of a table data type column (currently it's tank (3) and you want to change to char (4)). Here are more details on the table:-

    • Contains more than 20 million lines.
    • Table contains several indexes.
    • Table is referenced by several tables (about 60 tables) and it refers to several tables (about 3)
    • Table has 4 complex triggers. Triggers call procedures and packages.

    What I've tried so far


    1 disabled all triggers and ran ALTER statement to increase the length. It took hours and did not finish in a reasonable amount of time, even if no error, but it took more than 12 hours.

    2 tried DBMS_REDEFINITION package but it does not work with the standard version of Oracle 10 g.

    I think to try next

    I think same Optics:

    Say my name of the existing table is OLD_T1 where the length of column need to increase

    -Create a copy (with increased column length) table of OLD_T1, Say NEW_T1

    -Move data from in OLD_T1 to the new table NEW_T1

    -Lower OLD_T1 (or rename it to OLD_T1_TMP)

    -Rename NEW_T1 to OLD_T1

    -Create all indexes, triggers, constraints etc..

    I wish to confirm, if my approach is correct? Or someone has a better idea to do this?

    Please note: I know that the CHAR data type gives the problem but it is an old system and I don't have authority to change the design of database.

    Appreciate any comment/suggestion

    Thanks in advance

    > I mean, can any application break if it depends on fixed-length?

    Yes, because the code can be expected completed on the right areas.

  • Need help to modify the length of the column

    Hi Experts,

    I need to change the length of a column of char (10) to CHAR (5), but it is to show the error of:
    ALTER TABLE appr_group_table MODIFY (APPR_TBLNO CHAR(5)) 
    It is to show the error below:
    ERROR at line 1:
    ORA-01441: cannot decrease column length because some value is too big
    I checked in the dbase, but there is not any value in this column with more than 5 characters:
    SQL> SELECT APPR_TBLNO FROM appr_group_table;
    
    APPR_TBLNO
    ----------
    ANTAB
    ANTAB
    ANTST
    SCCTR
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    
    11 rows selected.
    Thnx in advance for help out me...

    tank means fixed length variable. When you say char(10) oracle reserves 10 spaces for your data. to your output, it means that you are, because spaces are also considered to be data. This is the reason why, it does not reduce the size.

    best solution is to create a new column with the data type varchar2 or char (5) and transfer the data in this column in the new column, and then delete the original column.

  • The number of column max OBIEE 11display in narrative mode

    Narrative mode, how to configure the display max column?

    Hello

    (1) make a backup of your there
    C:\Oracle\Middleware\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1\instanceconfig. XML

    (2) view narrative, you must add below the elements are.

    Just include b & w


    40000
    1000

    (3) save your changes and close the file.

    (4) restart Oracle Business Intelligence "Bi_Presentation_Services."

    i.e:note that this example does not include the elements that can exist in the file,
    but which are managed centrally by Fusion Middleware control and cannot be changed manually.

    For more view narrative: instanceconfig.xml (increase not columns/rows)
    http://docs.Oracle.com/CD/E23943_01/bi.1111/e10541/answersconfigset.htm#CIHHBHAI
    (Note: see the section, 18.3.1.2 Manual Configuration of the parameters for the data in the views)

    Thank you
    Deva

  • Insert data according to the length of column in table

    Hello

    If the length of the characters is more than one defined causes error. It's very embarrassing especially when get data dynamically

    and our query does not insert information that we expect.

    While trying to find the solution an idea came to my mind that, before insertion, so we check that the next data is greater than the specified length

    Take only the amount of characters that can be inserted and ignore the rest.

    I thought that the query as follows but failed.
    SQL> insert into cvDetails(cv_id,objectives) values(9687,substr("Hello",1,3950));
    insert into cvDetails(cv_id,objectives) values(9687,substr("Hello",1,3950))
                                                               *
    ERROR at line 1:
    ORA-00984: column not allowed here
    Is it possible to insert data up to the amount this column length defined by ignoring the obsolete characters and if the data

    length is less defined length of column, and then insert it as it is?

    Thank you in anticipation

    Hello

    Do not use double quotes as the string delimiters:

    SQL> create table test_nsa (str varchar2(10));
    
    Table created.
    
    Elapsed: 00:00:00.88
    SQL> insert into test_nsa values (substr('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',1,10));
    
    1 row created.
    
    Elapsed: 00:00:00.08
    

Maybe you are looking for

  • How can I add contacts to a mailing list if they do not have an email address?

    I try to add a contact to a mailing list and the contact has an e-mail address. In the mailing list, it says "type email addresses to add to the mailing list." I do a fake e-mail to those contacts who do not?

  • Satellite M100: touchpad corner functions do not work

    Hello My Satellite M100 quick launch functions on my touchpad stop working. The touchpad works fine, but the corner top don t functions. He won t acknowledges me even hit the corners when I go to the quick launch of installation area. I reinstalled t

  • Wil Firefox won't open a new tab neigther with + or Ctrl + T

    Wil Firefox does not open a new tab and more (manually).Not with the + on the site tabnor with Bestand - new tab or Ctrl + T

  • Satellite P20-552 does not start

    Hello currently operating on WinXp SvcPACK 2 and my graphics card do not work... I downloaded the drivers and the computer does not start it could freeze on a black screen then restart se...Help, please...Thank you...

  • Recovery image NB 305 on SD card

    I did a little experimentation and I would like to share the following: I managed to create a usable recovery image by doing the following. 1. buy a micro SD 8 GB card, place it in an SD adapter. (or buy a 8 GB SD card)2. Insert the SD card in the us