How to Insert Data into a Table in SQL Plus – Oracle 10G

In the previous post we learned to create a table in oracle. Today lets insert data into the table we created. Below is the format of the table we created. first_name, last_name, sex and age are the columns in our table.

table format

So to insert data into these columns  type :

insert into team values(‘Anish’,’Sangamam’,’male’,23);

Here team is the table name. Similarly,   insert into team values(‘anish’, ‘last’, ’20’, 10);

oracle 1

Insert Values into the Table at Run-time

Inorder to insert values at run time you need to add the amperand sign before the column names and instead of putting in the values you simply type ampersand followed by the column name.

Insert into team values(‘&first_name’,’&last_name’,’&sex’,’&age’);

When you run the query it will ask you for the firstname, lastname,sex and age.



Leave a Reply