Display Mth to Nth Column in a Table

How to display data in the table between mth column to nth column in a table in Oracle?

Questions by bharaththiruveedula

Showing Answers 1 - 1 of 1 Answers

Hi, I don't think there exists predefined pseudo column for column number in oracle. I have done a procedure, which creates a view for displaying data from Mth to Nth column in a table. Hope it helps.

Code
  1. span style="font-style: italic;">-- USER_TAB_COLUMNS -> contains Columns of user's tables, views and clusters

  2. -- create a cursor, that has all the column names and it's corresponding column number.

  3. 'table_name'-- Fetch the columns that's between the given criteria

  4. ','-- Create a view to display the data between the columns.

  5. 'CREATE OR REPLACE VIEW myview AS SELECT '' FROM table_name'-------------------------------------------------------------------------------------------------------------------------

  6. -- specify the column numbers to display the data in between.

  7. -------------------------------------------------------------------------------------------------------------------------

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions