Unix Technical Forum

How to know size of a SQL query

This is a discussion on How to know size of a SQL query within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hello I'd like to know the datatype of all columns of a SQL query. For instance, for the query ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 09:49 AM
thibaut neiger
 
Posts: n/a
Default How to know size of a SQL query

Hello

I'd like to know the datatype of all columns of a SQL query. For instance,
for the query : "select NAME, PHONENUMBER from PEOPLE", I'd like to get the
type of NAME and the type of PHONENUMBER (varchar and number, in my
sample).

I can do this by doing a "desc PEOPLE". It will work in my sample, but not
with a more complexe query like "select NAME, JOBNAME from JOBS j, PEOPLE p
where p.JOBID = j.JOBID". How to get the size of NAME and JOBNAME ?

I need this in order to create a generic window that can show results of
any given query.

thanks you

Neiger Thibaut
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-07-2008, 09:49 AM
Thomas Kellerer
 
Posts: n/a
Default Re: How to know size of a SQL query

thibaut neiger schrieb:
> Hello
>
> I'd like to know the datatype of all columns of a SQL query. For instance,
> for the query : "select NAME, PHONENUMBER from PEOPLE", I'd like to get the
> type of NAME and the type of PHONENUMBER (varchar and number, in my
> sample).
>
> I can do this by doing a "desc PEOPLE". It will work in my sample, but not
> with a more complexe query like "select NAME, JOBNAME from JOBS j, PEOPLE p
> where p.JOBID = j.JOBID". How to get the size of NAME and JOBNAME ?
>
> I need this in order to create a generic window that can show results of
> any given query.
>

In which language are you developing your application?

In Java you can retrieve this information from the ResultSetMetaData object.


Thomas

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com