Home » SQL & PL/SQL » SQL & PL/SQL » Primary key and unique key
Primary key and unique key [message #1306] Fri, 19 April 2002 04:02 Go to next message
shankar
Messages: 29
Registered: January 2002
Junior Member
1) What is the difference between a primary key and unique key.How many nulls will unique key allow.
2) what is a cursor?please explain with an example
Re: Primary key and unique key [message #1307 is a reply to message #1306] Fri, 19 April 2002 05:28 Go to previous message
Jay
Messages: 127
Registered: October 1999
Senior Member
1.A table can have only one primary key but it can have many unique constraints.
2.When a primary key is defined the columns that compose the primary key are automatically mandatory(NOT NULL).While when a unique constraint is defined,the columns that composes the unique constraint are not automatically mandatory.You must specify that the column is NOT NULL.

CURSOR: The Oracle Server uses work areas called private SQL areas or context areas to execute SQL statements and to store processing information.A cursor is a handle or pointer to the context area.Through a cursor,the PL/SQL program can control the context area and what happens to it as the statement is processed.
You should find examples of cursors in any book of PL/SQL.
Previous Topic: How to know datatype?
Next Topic: Why require insert into command
Goto Forum:
  


Current Time: Fri Apr 26 00:15:51 CDT 2024