Re: A Pro*C question..

From: Lawrence James <James.Lawrence_at_epamail.epa.gov>
Date: Tue, 27 Dec 1994 08:17:36 GMT
Message-ID: <James.Lawrence.86.00084B56_at_epamail.epa.gov>


In article <D1A6v3.BFx_at_mail.auburn.edu> vasudevy_at_eng.auburn.edu (Vasudev V. Yendapally) writes:
>From: vasudevy_at_eng.auburn.edu (Vasudev V. Yendapally)
>Subject: Re: A Pro*C question..
>Date: Fri, 23 Dec 1994 20:42:39 GMT
 

>
>In article HBy_at_mail.auburn.edu, vasudevy_at_eng.auburn.edu (Vasudev V. Yendapally) writes:
>>Hi,
>> I'm trying to "describe" a given table and get the
>>table attributes into some variable names. I'm able to
>>execute any statements that involve "SELECT, INSERT, UPDATE,
>>DELETE " but when it comes to "describe tablename" no
>>action is performed and I simply exit the program.
>>Can someone explain me how I can get these variables to
>>be stored and can be displayed (using Pro*c ofcourse!)?
>>
>>Please send any of your replies to my E-Mail address :
>>
>>vasudevy_at_eng.auburn.edu
>>
>>Thanks for your time.
>>
>>Vasu/..
>>
>>
>>---
>>**************************** *********************************
>> Vasudev Yendapally 333 EastMagnolia Ave # 3
>> Dept. of Computer Science Auburn AL - 36830
>> Auburn University Phone (205)-821-3501
>>**************************** *********************************
>>
 

>Thanks to everyone who promply replied to my question. I got it working.
 

>The methods that were suggested were.
 

>1. Fire off a sqlplus script that spools the desc statement to
> a file, then open and read the file into your variables.
 

>2. define a cursor to select rows from user_tab_columns and
> organized the returned values into your variables.
 

>Thanks again
>Vasu/..
 

>---
>**************************** *********************************
> Vasudev Yendapally 333 EastMagnolia Ave # 3
> Dept. of Computer Science Auburn AL - 36830
> Auburn University Phone (205)-821-3501
>**************************** *********************************

There is another way that doesn't rely on the data dictionary, thus works for all versions and other SQL databases. Create a 'select * from <table> dynamic cursor. Then have it parsed and describe it. The describe will return you the column specifics. Then just don't execute it.

Lawrence.... Received on Tue Dec 27 1994 - 09:17:36 CET

Original text of this message