Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

It is possible to select a column by position number instead of column name?

golze.Jan 18 2018 — edited Jan 19 2018

Hello,

it is possible to select a column by position number instead of column name?

For example i want to change an sql from

select a, b, c

from test

in

select column(1), column(2), column(3)

from test

Sincerly

explained:

I need to make a function that access tables (~30) that are all similar build but have different column names.

The tables are like that generally like that with same field types:

type, id, pos, text

but unfortnally they are all different named like

art, adrnr, pos, text

type, kadrnr, pos, text

doctype, docnr, pos, text

...

The tables contain rtf-text in the column text.

I must write a function that takes the tablename, type and id as parameter

and delivers the concated text with these field names:

type, id, text

Any advise for a generally working function? Wont to try avoid name mapping or views.

added explain

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2018
Added on Jan 18 2018
9 comments
16,639 views