Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding data type for a column

Re: Finding data type for a column

From: Scott Cook <Scott.Cook_at_ska.com>
Date: 1996/10/24
Message-ID: <326FC62E.65E9@ska.com>#1/1

Jedi wrote:
>
> Hi,
> I am trying to find out the data type of an column from within my
> applicaton.
> What is the ODBC or SQL statment to do that? For example, I have a table
> called
> Students and I want to know what data type the column name Address
> belongs to.

You need to go into the sys..... tables in your database. This is from MS SQL Server. It should
get you going on the right track.

select t.name
from sysobjects o, syscolumns c, systypes t, sysindexes i, syscolumns c1 where o.name = @table and o.type = 'U' and c.id = o.id and t.usertype = c.usertype and o.id = i.id
and (i.status & 0x800) = 0x800 and c.name = index_col (@table, i.indid, c1.colid)
and c1.colid <= i.keycnt and c1.id = @table_id order by c1.colid Received on Thu Oct 24 1996 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US