Home >> FAQs/Tutorials >> Oracle DBA FAQ >> Index

Oracle DBA FAQ - Introduction to Oracle SQL Developer

By: FYIcenter.com

Part:   1  2  3   4  5  6 

(Continued from previous part...)

How To Get a CREATE Statement for an Existing Table?

You have an existing table and want to get a CREATE statement for that table, you can use the SQL tab in the object view. The following tutorial steps show you how to use SQL Developer to generate a CREATE statement on an existing table:

  • Double-click the table name JOBS in the object tree area.
  • Click the SQL tab in the object view area.

In a moment, you will get the following CREATE statements:

REM HR JOBS

  CREATE TABLE "HR"."JOBS" 
   (	"ID" VARCHAR2(10 BYTE), 
	"TITLE" VARCHAR2(35 BYTE) CONSTRAINT "TITLE_NN" 
		NOT NULL ENABLE, 
	"MIN_SALARY" NUMBER(6,0), 
	"MAX_SALARY" NUMBER(6,0), 
	 CONSTRAINT "ID_PK" PRIMARY KEY ("ID") ENABLE
   ) ;
 
REM HR ID_PK

  CREATE UNIQUE INDEX "HR"."ID_PK" ON "HR"."JOBS" ("ID") 
  ;

How To Create a Table Interactively?

If you don't want to use SQL statements to create a new table, you use SQL Developer to create one interactively. Follow the steps below to create a new table called: TIP

  • Right-click on the Tables in the object tree area.
  • Select Create TABLE. Create Table window shows up.
  • Enter Name as: TIP
  • Enter Column Name as: ID, for column 1.
  • Select Type as: INTEGER, for column 1.
  • Click Primary as: Checked, for column 1.
  • Click Add Column to add column 2.
  • Enter Column Name as: SUBJECT, for column 2.
  • Select Type as: VARCHAR2, for column 2.
  • Select Size as: 80, for column 2.
  • Click OK.

How To Enter a New Row into a Table Interactively?

If you don't like to use the INSERT statement to enter a new row into a table, you can use the object view to enter it interactively. Follow the steps below to enter new row into table TIP:

  • Double-click on the table name TIP.
  • Click the Data tab in the object view.
  • Click the Insert Row icon, the + sign.
  • Enter ID as: 101.
  • Enter SUBJECT as: Backup #1.
  • Click the Commit Changes icon.

You know the new row is serted, because the log area shows you:

INSERT INTO "HR"."TIPS" (ID, SUBJECT) VALUES ('101', 'Backup #1')
Commit Successful

What Is the Reports View in Oracle SQL Developer?

The Reports view lets you browse database information that organized by the server as special views. Information can be browsed include:

  • Database parameters
  • Storage information
  • Session information
  • Cursors
  • Data objects
  • User accounts
  • Security informaiton

How To Get a List of All Tables in the Database?

If you don't like to use a SELECT statement to get a list of all tables in the current database, you can use the Reports view to do this as shown in the following tutorial example:

  • Click menu View.
  • Selects Reports from the menu.
  • Open Reports.
  • Open Data Dictionary Reports.
  • Open Table.
  • Double-click User Tables. You see the Enter Bind Values window.
  • Click Apply.

You should get a list all current tables in the database.

(Continued on next part...)

Part:   1  2  3   4  5  6 


Selected Developer Jobs:

More...