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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SQL text parsing to get table and column names ?

fxmatzDec 23 2013 — edited Dec 24 2013

Hi Friends,

is there a solution on 11i or 12c DB's to get the table and column names of the result columns from a complex SQL text ?

Here a little demo:

Input::

select a.cola,

         b.coly   alias_b.colb,

         (select x.colx from tablex)   alias_x.colx

    from tablea a,

         (select coly from tabley y where a.id=y.taby_a) b

    where a.id exists (select 1 from tablex x where x.id=a.taba_x

    /

 

Output::

  table   column

  -------------

  tablea  cola

  tablex  colx

  tabley  coly

I have seen a solution a while ago ..

One possibility would be with util_xml but this goes only for non-complex SQL's.

Many thanks.

Comments

EJP
The only way you can override a method in Java is by defining a class that does so, either statically or as an anonymous inner class. You can't do either of those things in JNI. Ergo you cannot do what you are asking about.
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 21 2014
Added on Dec 23 2013
5 comments
3,279 views