Obtain underlying table of a select list item per OCI

From: Mathias Waack <M.Waack_at_gmx.de>
Date: Mon, 02 Jun 2008 12:34:08 GMT
Message-ID: <4NR0k.512$9W3.42551@se2-cb104-9.zrh1.ch.colt.net>


assume a situation where we have two tables:

create table t1 (c1 number, c2 varchar2(10)); create table t2 (c1 number, c2 date);

and a select like this:

select t1.c1, t2.c1 from t1, t2;

This statements comes as an opaque string into an OCI routine which tries to analyze the query. Its easy to obtain column names, datatypes aso from the query, but OCI returns only the short column names. Thus the select list from the query above becomes (c1,c1). Is there a way to distinguish both columns within OCI?

I'm currently extending an application which generates queries which joins tables containing columns with the same name. Would be nice to find out, which column comes from which table.

Mathias Received on Mon Jun 02 2008 - 07:34:08 CDT

Original text of this message