find the length of column

Hi experts

I pulled a simple query on a large table that have more than 500,000,000 records. Here you find the length of records that have more than 10. But it takes too long to execute, and the other thing is that it did not all indexes. Please check my request.

Select max (length (ename)) from emp; -I got 12

and to determine the number of records that have lasting more than 10 pulled the query below.

Select count (ename) from emp where length (ename) > 10; -It takes too long to run... more than 5 hours and it is still ongoing.

Please let me know is there any query better.

Thank you very much

Instead, we try this -

create table X(ename varchar2(10));

BEGIN
  DBMS_ERRLOG.CREATE_ERROR_LOG(dml_table_name => 'X');
END;

Insert into X
Select ename from 
LOG ERRORS
REJECT LIMIT UNLIMITED;

/* Here using DML ERROR LOGGING technique we can trap all records into this table - ERR$_X */

select count(ename) from ERR$_X;

This should be quick coz we will not do a FTS (full Table Scan) on the main table. But... NOT TESTED.
Please try this and let me know if no door.

Hope this helps,
Vanessa B.

Published by: Vanessa B on December 14, 2012 15:46

Tags: Database

Similar Questions

  • Is there a way to find the length of a line, not a column

    I'm trying to find the length of a particular line in a table... is it possible?
    I don't mean length of the column value... I can get by using LENGTH (COLUMNNAME)
    I'm not average line length, I can get extended calculation or using the trace file.
    Please let me know if there is a function, that allows to calculate or any other solution.

    Thank you!

    >
    (1) select avg_row_len from dba_tables
    where table_name = 'abc ';
    I got the length of the average line like 65
    That means 65... It is 65 bytes/KB/MB, or what exactly is 65?
    >
    This means that 65 bytes - see ALL_TABLES in doc database
    http://docs.Oracle.com/CD/B19306_01/server.102/b14237/statviews_2105.htm#i1592091
    >
    (2) also a member of the team of mine use this query:
    SELECT sum (data_length) FROM ALL_TAB_COLUMNS WHERE
    table_name = 'ABC ';
    and divided the result above with the number of rows in this table

    Suppose that gives only the length of the average column type... is not our requirement?
    >
    At best, that would give you the MAXIMUM length that COULD be a line. It will not help at all. For example all columns defined as NUMBER (with any precision or scale) appears in the form of bytes 22 since they can take a lot. And a VARCHAR2 (4000) will be listed as 4000 even if it is NULL or if the average length is 2 bytes.

  • How to find the primary key columns in the tables in MS Access using SQL queries

    How to find the primary key columns in the tables in MS Access using SQL queries

    Hello

    This is the forum for Windows Vista programs related issues.

    For better assistance, please try instead the Forums in SQL Server .

    Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo

  • How to find the number of column under Basic forms

    Hi all

    There is the serial number in the pay_assignment_actions Table column
    Through basic shapes where can I find the serial number column
    Is someone can you please tell me what would be the navigation.

    Thanks in advance

    You need to check the correct recording-
    It would be visible only for those guys-

    Void Payment
    Ext/Manual payment
    Cheque writer
    Magnetic report
    
  • Find the length of a segment in CS6

    Hi, I need to find the length of direct a segment of line I draw on CS6, but it doesn't seem to be a simple way to do it. Tabs of information and the document Info palette simply give Xy and width and height. I have a value called D occasionally flash on the pallet, but seems not updated correctly and I can't seem to appear more and he makes me a key. Is there an easier way to do outside the measurement tool which is also awkward and I'm not sure correct?

    Try to use the Document Info Panel flyout to select objects and make sure that it is set to the selection. With the path selected the top line will give information on this path, including the length in units of document.

  • 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
    
  • A way to find the length of a selected title?

    Hey people.

    completely new to first. I went through the Lynda.com training videos, so I have an idea of what I'm doing, but I don't know where I can find the specific length of a clip selected in the timeline. In this case, I have two clips (a title with dips to black on both ends) and then the same thing with different title and I need match their length.

    I know how to set the length of the dips; I suppose I could just put in some length makes it fit in the middle of a title and then use it to set the length of the second title, but that seems heavy.

    I can get the length of the CLIPS pretty easily as double-clicking them top made appear in the source window, but it does not work for titles (at least for me).

    Thanks in advance!

    CTRL + double click on titles on your timeline to bring them back in the source monitor. Double click on a regular basis brings them in the default Titler.

    If you want to know the length of any clip on the timeline you can select, and then display the "Info" Panel which is in the Group of lower left corner of panel mounting set default workspace. You can also open the Info Panel by selecting window > info.

    You can also put your cursor over the clip on the timeline and wait a moment, the information area will pop up and you talk about the duration of the clip.

  • What is the length of column maximum name?

    What is the length of maximum column name in Oracle (XE)?

    Peter

    user559463 wrote:
    What is the length of maximum column name in Oracle (XE)?

    Peter

    30 characters

  • How to find the length of curves?

    Help me please!
    I need to find a length of curves in clip placed on stage. It is not created by a script drawing. At least, I need to find our association to the properties of the points and controllers of curves in order to calculate the length. It is even beter than just length.

    In other words, it there is no way to access the properties by using the functions of AS3 and even layout of the Flash editor? I think it's a way to work in future versions of AS and flash.

    Thanks for the replies.

  • How to find the length of a certain number in labview?

    Hi all

    I am Pramod in Bangalore.

    I need to know is all their VI which calculates the length of a number.

    For example, for the number 1000, length is 4. Same I need is calculated automatically in VI, instead of manually.

    Kind regards

    Pramod M G

    If the number is in a control or the indicator, you can do it like this:

  • find the length of the string

    Hi all

    I have a srting that contains two or more channels as for instance, it's my channel (think of this total string as one string) "Bronson, Ms. Jamie", "elder, Ms. Francis '.
    Now I want to calculate the length of the string of replacement of commas and apostrophes with null.

    Can someone pls help me with this?

    Thank you
    SQL>
      1  with t as (
      2   select '''Bronson, Ms. Jamie'',''Elder, Mrs. Francis''' as mystring
      3  from dual)
      4  select * from t;
    
    MYSTRING
    ------------------------------------------
    'Bronson, Ms. Jamie','Elder, Mrs. Francis'  
    
    SQL>
      1  with t as (
      2   select '''Bronson, Ms. Jamie'',''Elder, Mrs. Francis''' as mystring
      3  from dual)
      4  select replace(replace(mystring, ',', null), '''', null) from t;
    
    REPLACE(REPLACE(MYSTRING,',',NULL),
    -----------------------------------
    Bronson Ms. JamieElder Mrs. Francis
    
    SQL> l
      1  with t as (
      2   select '''Bronson, Ms. Jamie'',''Elder, Mrs. Francis''' as mystring
      3  from dual)
      4  select length(replace(replace(mystring, ',', null), '''', null)) as string_len from t;
    
    STRING_LEN
    ----------
            35  
    
  • What is the best method to find the length of a series in xml format.

    What is the preferred/better method to get the 'length' of a set of xml nodes? Currently I use a "for in" loop and using the value of variable end. This works very well, but seems inelegant, inefficient. Any opinions? suggestions?

    Thank you

    M.

    Something like this:

    public void xmlParser(myData:XML)
    {

    var listItems:XMLList = myData.listItem;

    var len:int = listItems.length ();

    creates two tables
    for (var j: uint = 0; j <=> len; j ++) {}
    masterArray [j] = listItems [j]
    flexArray [j] = listItems [j]
    }

    addListeners();
    listLoader (flexArray);
    }

  • Where can I find the Designer Description column of the repository?

    I recently posted a question on where to find roles in the data model in the designer (what I was looking for was in ci_business_units (role_responsibilities column). It was a good discussion (and I was happy to find a group of Designer).

    Now I'm looking for the 'Description' field, here:

    Designer-Description.png

    I looked at all these tables, but couldn't find what I was looking for:

    sdd_folders app

    sdd_folder_members afm

    crazy sdd_folders

    sdd_folder_members fms

    MDS ci_modules

    ci_general_modules gen

    ci_module_business_units mbu

    BNU ci_business_units

    I also looked for like '% DESC' columns across d.b. and nothing seemed to be what I'm looking for.

    Hi Wim,

    On the technology blog of AMIS "Quick Query reporting on the entities and attributes in the designer of the Oracle", there is a https://technology.amis.nl/2006/02/16/quick-query-to-report-on-entities-and-attributes-in-oracle-designer/ article in this article they need the Description of entities and the Attrbiutes which is located in CDI_TEXT. Maybe the same goes for modules.

    Kind regards

    Mark

  • Find the length on the numbers formatted

    Hello

    IAM using oracle v11.0
    "select length (to_char ('0.0 ','990.0 ')) from dual"
    While executing the statement above Iam get 6 instead of 5. is that it is no reason to specfic for this?

    Concerning
    Oracle user

    Yes, because there is a space for the sign of the number. If you want to exclude only the use:

    select length(to_char('0.0','fm990.0')) from dual
    

    Edit:

    p.s. it give you a length of 3 as "0.0" is 3 characters long.

    Published by: BluShadow on February 28, 2011 12:06

  • How to find the length of netStream?

    Hai,

    I try to get the duration of my video netstream... someone knows the solution to this prblem please help me

    Thank you

    Dembélé

    Quick Google search found several possible solutions:

    http://help.Adobe.com/en_US/AS2LCR/Flash_10.0/help.HTML?content=00001405.html

    http://www.Kirupa.com/Forum/showthread.php?305018-problem-displaying-duration-time-NetStream

    http://12s.twelvestone.com/conversations/onMetaData-NetStream-obj-duration-losing-scope-with-in-an-a... (see result near end of posts pyrigeb that starts with 'Yes, who does').

Maybe you are looking for

  • IPhone 6 and 6 s go to recovery after updating ios 10

    AFTE 10 with itunes my iphone i0s update 6-6 s rise to the recovery and no start Help me

  • HP Photosmart 5520: Printer prints blank pages suddenly

    Yesterday, my printer decided that he would simply print blank pages with a black line in the middle. I did a test print via the configuration menu and it prints fine. My wife can print wireless. And until yesterday I had no problem. On and off, but

  • Microsoft silverlight update

    I have a mac computer and just recently, I found that whenever I want to send an email from my hotmail account a windows popup "microsoft silverlight update" and preventing me from sending emails, is a new funny virus

  • WU seems to be eating my CPU

    Suddenly, since this morning, my cpu is fierce. I had to disable Windows Automatic Update. When I go manual for Windows Update, cpu runs high return! Nothing is happening during manual updates. I applied KB2879017 on IE 8 this morning. But as soon as

  • I have a Window XP Acer Aspire 10 inch notebook that I can not connect

    I also have a problem. Although several times I tried to connect to my password and simple said that it was not the right password, but... I have a very simple password and yet it had been almost a month now that I can't connect it. I tried to start