Newsgroups: comp.databases.oracle From: James.Lawrence@epamail.epa.gov (Lawrence James) Subject: Re: A Pro*C question.. Sender: usenet@rtpnc.epa.gov ( News Account ) Message-ID: Date: Tue, 27 Dec 1994 08:17:36 GMT Lines: 59 References: Nntp-Posting-Host: beta-host13.rtp42tok2.epa.gov Organization: United States Environmental Protection Agency X-Newsreader: Trumpet for Windows [Version 1.0 Rev Final Beta #8] In article vasudevy@eng.auburn.edu (Vasudev V. Yendapally) writes: >From: vasudevy@eng.auburn.edu (Vasudev V. Yendapally) >Subject: Re: A Pro*C question.. >Date: Fri, 23 Dec 1994 20:42:39 GMT > >In article HBy@mail.auburn.edu, vasudevy@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@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 dynamic cursor. Then have it parsed and describe it. The describe will return you the column specifics. Then just don't execute it. Lawrence....