By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

how to get colunms displacement for a table in Oracle?

P: 5
How do I get columns displacement for a table or tables in Oracle? Is there a command for it?

I am thinking about to write a COBOL program to do this by read in the output of SQL/PLUS DESC TABLE-NAME and format its column length to get the displacement. But, I think some of you must have a better way to this. Please advise!

Thank you for you help!
--Hiep
Jul 28 '08 #1
Share this Question
Share on Google+
7 Replies


debasisdas
Expert 5K+
P: 8,127
try to use dictionary object USER_TAB_COLS
Jul 29 '08 #2

P: 5
Thank you Debasisdas!
I am looking to that.. if you have example of SQL statements that would be great..

Again thank you for your help.
--Hiep
Jul 29 '08 #3

debasisdas
Expert 5K+
P: 8,127
what exactly you are trying to findout ?
Jul 30 '08 #4

P: 5
Hi debasisdas,

I need to unload a table into a flat file and want to know the column name, length and the start position of each column.

I'll need these information on every table in the Oracle data base. I'm using 10g.

Again, thank you in advanced for your advise.
--Hiep
Jul 30 '08 #5

debasisdas
Expert 5K+
P: 8,127
you can use this

select * from user_tab_cols

but since you want for number of tables better write a procedure for that.
Jul 30 '08 #6

P: 5
you can use this

select * from user_tab_cols

but since you want for number of tables better write a procedure for that.

Thank you debasisdas!

Do you know the way to set the sql/plus to display the whole line without wrap around or trunkcated?

select * from user_tab_cols will display a long line and it warped around so it hard to read. I set wrap off then it truncated. I set linesize 132 but it still wrap around.

--h13p
Jul 30 '08 #7

debasisdas
Expert 5K+
P: 8,127
you need to use

SET LINE SIZE 1500
PAGE SIZE 200
Jul 31 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.