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

Recommended Answers

All 3 Replies

Would you mind post rest of the code? As from that one line we can't find anything

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.