Home > How to view and edit table column definitions
Chapter Download:
EMAIL THIS

How to view and edit table column definitions

12 Mar 2009 | Written by: Joel Murach

Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Murach's Oracle SQL and PL/SQL

Chapter 2, How to use Oracle SQL Developer and other tools

This chapter from Murach's Oracle SQL and PL/SQL explains how to work with Oracle SQL Developer and other tools. In this section, learn more about table column definitions, including how to edit and view column names and column definitions for a table, and when to use SQL Developer.

Table of contents:

[IMAGE] How to work with an Oracle database home page
[IMAGE] How to use SQL*Plus in Oracle
[IMAGE] How to use SQL Developer to work with an Oracle database
[IMAGE] How to view and edit table column definitions
[IMAGE] How to use SQL Developer to run SQL statements
[IMAGE] How to use the Oracle Database SQL Reference manual

[IMAGE]

How to view the column definitions for a table

To view the column names for a table, you can expand the node for the table. In figure 2-6, for example, I expanded the node for the Vendors table so the names for all of columns in the table are displayed below the table. To view the column definitions for a table, you can click on the table name to display a table that contains the definition of each column. In this figure, for example, the right-hand window shows a table that contains the definitions for each column in the Vendors table. For each column, this table shows the column name, the data type, an indication of whether or not...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Oracle and SQL
Can I specify Oracle column order in my database table?
Review: Oracle's 11g R2 database has some good and bad
SELECT statement syntax and examples
Oracle PL/SQL tutorial
PL/SQL datatypes in Oracle
PL/SQL functions and triggers in Oracle
Stored procedures in PL/SQL
Do I need a license for SQL Developer Data Modeler in Oracle?
Using the SQL GROUP BY clause for counting combinations
How to use an SQL CASE expression
Oracle and SQL Research

Oracle DBA tools
Oracle delivers database fixes in Critical Patch Update
How to get the most out of Toad for Oracle 10
Q&A: Toad for Oracle 10 focuses on developer, DBA productivity
Review: Oracle's 11g R2 database has some good and bad
Oracle OpenWorld 2009 Special Report
Oracle releases new database, says 11g upgrade will cut costs
EnterpriseDB offers Oracle database users a 'bailout program'
Oracle raises prices on database management packs
How to use the Oracle Database SQL Reference Manual
How to use SQL Developer to run SQL statements

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
CFML  (SearchOracle.com)
dynamic SQL  (SearchOracle.com)
foreign key  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)
Oracle  (SearchOracle.com)
stored procedure  (SearchOracle.com)
The Open Group  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


the column can contain null values, the default value, the position of the column within the table, whether or not the column is a primary key, and any column comments. By default, the columns are displayed in the sequence in which they were created.

How to view the data for a table

To view the data for a table, you just click on the Data tab after you display the column definitions for the table. By switching back and forth between the Column and Data tabs, you can quickly see how the data corresponds to the data definitions.

You can also use the Data tab to modify the data in a row, and you can use the Insert and Delete buttons at the start of this tab to add rows or delete rows. Then, if you want to commit the changes to the table, you can click on the Commit Changes button. Or, if you want to rollback the changes, you can click on the Rollback Changes button. In chapter 7, you'll learn more about committing and rolling back changes.

How to view the column definitions for a table

[IMAGE]

Figure 2-6 How to view the column definitions and data for a table

How to view the column definitions for a table

  • To view the column names for a table, expand the Tables node and then expand the node for the table you wish to view. This displays the columns in the Connections window.
  • To view the column definitions for a table, click on the name of the table in the Connections window. This displays detailed information about the columns of the table in the window to the right of the Connections window.
  • By default, the columns are displayed in the sequence in which they were created.
How to view the data for a table

  • Click on the Data tab in the window that's displaying the column definitions for the table.
How to edit the column definitions

If you want to edit a column definition, you can use one of the techniques described in figure 2-7 to display the Edit Table dialog box. Then, you can use this dialog box to add a column, delete a column, or modify a column.

If you want to display additional information about a column, you can select the column by clicking on it. Then, additional properties are displayed in the Column Properties group that's displayed on the right side of the dialog box. In this figure, for example, the properties for the DefaultTermsID column are displayed. In addition, a default value of 3 has been entered for this column. Note that the properties that are available change depending on the data type of the column. For a column with the VARCHAR2 data type, for example, the properties also indicate the length of the column. You'll learn more about that in chapter 8.

Most of the time, you won't want to use SQL Developer to edit the column definitions for a table. Instead, you'll want to edit the scripts that create the database so you can easily recreate the database later. However, if necessary, you can use SQL Developer to edit the column definitions for a table. In chapter 10, you'll learn more about creating and modifying the column definitions for a table.

How to edit the column definition of a table

[IMAGE]

Figure 2-7 How to edit the column definitions

Description

  • To edit the definition of a table, right-click on the table name, select the Edit command, and use the Edit Table dialog box to modify the table.
  • You can use the Edit Table dialog box to add a column, delete a column, or change the properties of an existing column such as the name, data type, default value, and so on.
  • You can also use the Edit Table dialog box to add, delete, or modify a table-level constraint, an index, or a table-level comment.
  • For more information about creating tables, see chapter 10.

Download the chapter "How to use Oracle SQL Developer and other tools" in PDF form.

Continue to the next section: How to use SQL Developer to run SQL statements




Oracle Tutorials and Expert Advice
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts