Re: Tablename qualifier in columns of select

From: Brian W. Chester <bwchester_at_home.com>
Date: Sat, 09 Oct 1999 13:23:30 GMT
Message-ID: <mlHL3.14366$Vg4.622778_at_news1.rdc2.on.home.com>


Geeta,

I'm not 100% sure this will work with OCI but give this a try.

select p.name "Person.Name", l.actiondate "Ledger.Date", l.amount "Ledger.Amount"
  from person p, ledger l
  where p.name = l.person
    and l.action = 'Sold'
/

This will return the name of the table with the column and as you can see, rename the column if you wish. You can also use the same technique to pass the table name when you do not specifically qualify it.

Hope it helps

Brian

ugtech_at_my-deja.com wrote in message <7tn1d8$3b5$1_at_nnrp1.deja.com>...
>Hi,
>
>Can anyone please tell me if there is a way to get the tablename
>associated with the columns selected in a select statement using OCI
>calls.
>
>e.g If I have a select statement such as select employee.empno,
>emptab.empno from employee, emptab is there any way by which I can get
>the tablename qualifier of each column.
>
>Also, if there is no qualifier specified in the select statement, is
>there a way to get the tablename associated with the column.
>
>OCI_ATTR_NAME doesnt seem to return the tablename qualifier.
>
>Please help.
>
>Regards
>Geeta.
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Sat Oct 09 1999 - 15:23:30 CEST

Original text of this message