RE: Get max length of data for a column [1 Attachment]
Dennis Paulus <[email protected]>
| Newsgroups | gmane.comp.db.oracle.toad.free |
|---|---|
| Message-ID | <F1AF36903B691E4CB52D98FE75A3475810067B37@ALVMBXW01.prod.quest.corp> |
Hi Chris, I know I was late in the game to this one, but perhaps this might help. I remembered doing something similar in a previous life, so I did some searching and found a script. The attached script is pretty old, but it might get you most of the way there and I'm sure it can be fine tuned quite a bit. :) It was just a quick and dirty script to get what I needed at the time. Some key ingredients of the script: 1) It uses EXECUTE IMMEDIATE, so it's definitely not the fastest, but it gets the job done. 2) It will skip over any data types that it can't calculate, such as LONG data types. I had no need to do that, but it could be added pretty easily. 3) It provides the ability to display for one table or all tables in a specified schema (see header notes for details on the calls). 4) If you have a lot of tables, a lot of columns, large db etc., you may want to insert the results into a table (or some other method), instead of using the dbms_output statements, to ensure you get all the results. 5) You'll want to run as a user that has priv's to dba_tables/dba_tab_cols. Hope this helps. Thanks, Dennis From: [email protected] [mailto:[email protected]] On Behalf Of Tryon, Christopher S Sent: Tuesday, April 17, 2012 12:17 PM To: [email protected] Subject: [toad] Get max length of data for a column I want to get the max length of data from all columns in a table. Is that something Toad provides? Chris ______________________________________________________________________ Attention: This e-mail and any files transmitted with it from Hatch Mott MacDonald are confidential and intended solely for use of the individual or entity to whom they are addressed. If you have received this e-mail in error please immediately notify the sender. ______________________________________________________________________