Insert value for specific columns : Insert « Insert Update Delete « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE myTable (
  2       name  VARCHAR2(25) NOT NULL,
  3       price NUMBER(4,2)  NOT NULL,
  4       start_date DATE);

Table created.

SQL>
SQL>
SQL>
SQL> INSERT INTO myTable (name, price) VALUES ('Product Name 2', 2.5);

1 row created.

SQL> INSERT INTO myTable (name, price) VALUES ('Product Name 3', 50.75);

1 row created.

SQL> INSERT INTO myTable (price, name) VALUES (99.99, 'Product Name 4');

1 row created.

SQL>
SQL>
SQL> SELECT * FROM myTable;


NAME                           PRICE START_DAT
------------------------- ---------- ---------
Product Name 2                   2.5
Product Name 3                 50.75
Product Name 4                 99.99

3 rows selected.

SQL> drop table myTable;

Table dropped.

SQL>
SQL>
SQL>








4.1.Insert
4.1.1.Adding Rows Using the INSERT Statement
4.1.2.Omitting the Column List
4.1.3.Insert value for specific columns
4.1.4.Specifying a Null Value for a Column
4.1.5.Including Single and Double Quotes in a Column Value
4.1.6.Insert double quote
4.1.7.Use trunc in insert statement
4.1.8.Combine three tables with 'insert into statement'
4.1.9.Insert default value
4.1.10.Truncate sysdate in insert statement
4.1.11.Adding Multiple Rows to a Table
4.1.12.Conditional INSERT Statement
4.1.13.to_date() and insert statement
4.1.14.To insert records into a table using a subquery: