Site icon NgDeveloper

AutoIncrement insert into example in db2

Ensure the field created as auto increment in the db and simply leave that field while writing insertion query. It will be automatically incremented if we insert the values.

Syntax:

Insert into table_name (column_name1,column_name2,column_name3) values (value1,value2,value3);

Note:

Values should be within single quotes if it is string.

Example:

Insert into student_details (rno,name,department) values (56,’naveen kumar’,’cse’);

 

 

 

Thanks for reading this post…………….!!!

Exit mobile version