creating a procedure that "describes" all of your

Results 1 to 2 of 2

Thread: creating a procedure that "describes" all of your

  1. #1
    Join Date
    Dec 1969

    Default creating a procedure that "describes" all of your

    I am taking an Oracle database class and the instructor has told us to create a procedure that "describes" all of my tables. Where do I look to do this or what code do I write in order to do it. Thanks, I need all the help I can get!!!

  2. #2
    Join Date
    Dec 1969

    Default RE: creating a procedure that

    I&#039;m not an oracle expert, but there is a view called user_tables<BR>that lists all the tables you have in your database and information about these tables -- name, owner etc .. My guess is that you could use a describe command that gives all the column information in a table within a loop that runs for all tables in user tables -- something maybe like this:<BR>DECLARE<BR> CURSOR my_cursor IS SELECT table_name FROM user_tables;<BR> my_table varchar2(30);<BR>BEGIN <BR> OPEN my_cursor;<BR> LOOP<BR> FETCH my_cursor INTO my_table;<BR> EXIT when my_cursor%NOTFOUND;<BR> describe my_table<BR> END LOOP;<BR> CLOSE my_cursor;<BR>END;<BR>/<BR><BR>this wont get you all the way there, but its a start -- this code is an anonymous block -- not stored procedure.<BR><BR>Hope this helps<BR><BR>Pete<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts