Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing / Priting out Tables in Oracle

Status
Not open for further replies.

2122002

IS-IT--Management
Apr 22, 2003
58
US
Dear all, here are the few questions:

1) What SQL*Plus command can I use to list all available tables in the Oracle directory (or when I logged into Student directory)

2) I created a VIEW file called StudAdmssion2006. What SQL Command can I use to print out all tables involved in my view definition For example:

Create View StudAdmssion2006 AS
Select S1.studntName, S1.StudNo,
S2.Cohort,S2.Misc, S2.StudNo,S2.Grad_Date, S2.Lecture

FROM StudPer S1, CO_HOT S2, Person P1
WHERE S1.StudNo = S2.StudNo;

3) I want my output to display fully on screen, just like A4 format, how do I do that?:

For example:

Select name, address, sex, age, Profession, qualificatoin
From Personnel;

 
These sound a lot like student questions, which we are not supposed to answer under the terms of this forum.
 
Yes, it sound like student Questoin. i have E-book (Introd to Oracle and SQL) and I also downloaded some Material from and "Oracle and SQL Manual" from Oracle Website for my practising, but I have some questoin which the E-book cannot answer.

This is why I asked these question. Sorry, but Im new to Oracle.

Thank you.
 
First, 2122002, could you please post a name with which we can greet you versus a Base-3 numeric string? I'd personally feel more comfortable.

Next, I need clarifications on each of your requests:
2... said:
1) What SQL*Plus command can I use to list all available tables in the Oracle directory (or when I logged into Student directory)
Oracle does not store tables in "directories" per se...Tables reside in schemas. If you wish to simplye list the names of tables in a schema, then the following works for you:
Code:
select table_name
from all_tables
where owner = '<upper-case spelling of subject schema>';
2... said:
2) I created a VIEW file called StudAdmssion2006. What SQL Command can I use to print out all tables involved in my view definition...?
What do you mean by print out? Do you want to display the values of all columns in all the tables in the view? If so, the best method to display all the contents of all the subject tables depends upon the maximum content widths of each column. To help manage those widths and "wrapping" behaviours, you can use SQL*Plus's "column" statement:
Code:
col short_desc format a15 word_wrap
select id, short_desc from s_product;

        ID SHORT_DESC
---------- ---------------
     10011 Beginner's ski
           boot

     10012 Intermediate
           ski boot

     10013 Advanced ski
           boot
2... said:
3) I want my output to display fully on screen, just like A4 format, how do I do that?
When you display your output currently, what does the display do (specifically) that you do not want it to do; what does the display not do (specifically) that you want it to do?

Let us kno on each point.





[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
For example, I can describe the content of the table:

describe Personnel;

As for the View file, I can also use the key word "describe" but If I want to know the associated tables that form a View file, how do I list them?.
 
To see the definition of a VIEW, which includes the "FROM" clause that defines the tables, you can say:
Code:
set long 50000
select text from user_views
where view_name = '<upper-case name of view you wish to see>';
Let us know if this is what you wanted.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Im IT Officer, not a Profesional like you and as well as a self-studying Student. I know about MS-Access ONLY, but studying Oracle alone with some E-books. but seems one can't pick good job on Access. Nothing to hide from you guys.

Thank you.


Dan
 
Guys, you are wonderful.

Can anyone send me a link/website where I can download some Oracle SQL Command?. Or some Free Oracle Tutorial.



Dan
 
Dan,

Google will give you everything you need...on both topics. Just Google for "Oracle SQL commands" (~ 2 million hits) and "Oracle Tutorial" (~ 3 million hits).[2thumbsup]

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top