Hello Ranchers, I'm doing a program in JSP and Oracle.. In that the oracle table details are here ------------------------------------------------------ column ------------------------------------------------------ reg_no name password confirm -------------------------------------------------------
in this table the reg_no is a primary key and there is a sequence ie., the number starts with 1000 and increment by 1
now from the jsp page.. i want to insert a new user registation details..
at that time the query i;m using is insert into table_name (reg_no,name,password,confirm)values (reg_no.nextval,name,password,confirm);
but it is not inserting and showing errors.. so what should i do to insert the values in to the table where there is a sequence and a primary key!!
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Megha Rajeevan
Greenhorn
Joined: Mar 22, 2006
Posts: 24
posted
0
hello Shalish.. Thanks for replying and sorry for the lack of information.. Actully it is showing the error.. invalid column name. ie., reg_no.nextval is a invalid column name..
Your syntax looks OK. Does the sequence reg_no exist and does your user have privileges to use it?
(BTW: when posting an exception message it is usually better to just cut and paste the message rather than posting what you think the message means. There is less scope for error that way) [ May 23, 2006: Message edited by: Paul Sturrock ]
To check if the sequence you are using exists and working or not try to run the following query on oracle through sqlplus (or any query runner interface)
select reg_no.nextval from dual;
If this results in a number then we can look further.
Thanks, Sunil
Megha Rajeevan
Greenhorn
Joined: Mar 22, 2006
Posts: 24
posted
0
Thank u RancherS!! Now the query is executing successfully.. I don't know what happened to it yesterday when ever i try to insert the values it was inserting 2 times.. and when i restarted my system.. it is ok now
i think there is some problem with the system cache..
any way thank you very much for your great support..