Hello Ranchers!!
I'm using
JSP and Oracle to do a project.
there is a table and the table details are here!!
==========================================================================
column nam
==========================================================================
register_num
name
age
=========================================================================
here for the register_num it is the primary key and also have a sequence generated..
the reister_num is a varchar2(20) datatype..
and tha value it assigns is
ERP/05/2006/001
here ERP is the sting that i passes
/05/2006 is the current month and the year..
after doing all these thing i can do concatenate the
string to produce like this
i'm using a condition also..
if(no >0 && no<=9) val = ERP/05/2006/00000
if(no >=10 && no <=99) val = ERP/05/2006/0000
if(no >=100 && no <=999) val = ERP/05/2006/000
if(no >=1000 && no <=9999) val = ERP/05/2006/00
if(no >=10000 && no <=99999) val = ERP/05/2006/0
this is what i've to do ..
but there is no change in the sequence..
the value that has to the inserted is
ERP/05/2006/000001
ERP/05/2006/000002
ERP/05/2006/000003
ERP/05/2006/000004
ERP/05/2006/000005
-----
ERP/05/2006/000100
ERP/05/2006/000101 like that...
---------------------------------------------------------------
so if i insert the value the query will be like this
insert into table_name(register_no,name,age) values(reg_no.nextval,name,age)
---------------------------------
this query is doing the inserting proceedure..
but it is just inserting the register_no as 1,2,3 etc
i want to chage that value and has to insert the String like this
ERP/05/2006/000001
================
please help me ranchers..
how can i do this problem
thanks in advance..
regards
Aravind Prasad