I have a form , where i will put the values to a table.
I wrote a insert statement for the same.
Table structure is
ename | character varying(30) |
eadd | character varying(30) |
eid | integer |
sal | integer
In the statements, i don't want to write all the column names and values. i mean
INSERT INTO emp (ename,eadd, eid,sal) VALUES (?,?,?,?);
i gave something in the last column i.e sal, then my sql statement should look like.
INSERT INTO emp (sal) values(that given in the form);
The Code should be dynamic. If we will fill 3 fields in the form then code should be
INSERT INTO tablename(col1,col2,col3) VALUES (val1,val2,val3);