Now Place:2uzhan.com » Getting column structure from view

Getting column structure from view

Oracle @ August 6, 2012   Views:0

Hi guys.

I'm currently working on a delphi application with data on oracle.
Since the program lets users print a bunch of reports, when I generate one of them I want to know exactly how long is each field going to be.

The select queries from the application are made exclusively on views.
What I would like to accomplish at the application's startup is to generate a list of all selected columns from all views with their data type and lenght, that way I can use it in the sw wherever I need to.

I am currently querying the ALL_VIEWS table an parsing the SQL text with a delphi procedure, but that doesn't seem to be working out as I hoped
I'm a basic oracle user and I was wondering if there was any other way I could proceed to get the info I want from every view. Any suggestions?



Have a look at USER_TAB_COLUMNS. This view contains both TABLE (in your case - VIEW) and COLUMN names, as well as data length, precision and other information you might be interested in.

© 2018 2uzhan.com Contact