1

i have a small problem in the jsp code i have written "to send the data from form to database".
The table in the database has a primary key field whose values must be generated automatically.
so, i have created a sequence named t_seq and have written it like this:

String s = insert into tr values(t_seq.nextval,.........)
but the data isn't getting inserted

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by vasudha k
0

That's illegal SQL if you want to set only a subset of the fields (which you want, as you aren't setting the PK field).
You have to supply the actual fields you're setting as well, and in the correct order.

0

thank you,
my code is working now.
There was a small problem in one filed which wasn't being inserted properly.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.