Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL VALUES Keyword      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: VALUES

Definition:
VALUES

In Oracle PL/SQL, the VALUES keyword appears in the conventional INSERT statement. It is a mandatory keyword in INSERT statement.

Example Syntax:

INSERT INTO TABLE[Column spec]
VALUES
[Columns values]


Example Usage:

The below INSERT statement inserts a row into EMP table

INSERT INTO EMP (EMPID, ENAME, DEPTNO, SAL, JOB_ID)
VALUES
(SEQ_EMPID.NEXTVAL, 'MILLER',10,4500,'DEV')
/

1 row inserted.


The VALUES keyword can also be used without specifying the columns, as shown in this example:

INSERT INTO EMP VALUES
(SEQ_EMPID.NEXTVAL, 'MILLER',10,4500,'DEV')
/

1 row inserted.


To use the VALUES keyword in this manner the number of values to be inserted must exactly match the number of columns in the table.


Related Links:

Related Code Snippets:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 327 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?