I have had trouble creating an ID for my form. I am currently using ASP Classic and Oracle I need to create an ID in which the current date and 2 additional numbers like: yyyymmdd
+ Auto increment in sequence order (2015031601, 2015031602) .
So far, I only return the current date value with the random number in my form which is created using the javascript in the Math.random ()
function. But the id actually needs to be automatically incremented in the number sequence.
The current date for the random number and the code for the math:
var date = new date (); Var nowadays = date.getDate (); Var Azam = date.getMonth () + 1; Var nowadays = date.getFullYear (); Var q = nowadays; If (daemon = l = = 9) {var y = "0" + daeman; } And var y = Azamohan; If (nowadays, & lt; = 9) {var z = "0" + nowadays; } Else var z = todaydate; Var k = Math.flur ((Math. Random) * 20) + 01); & Lt; / Script & gt; & Lt; Script language = "javascript" & gt; Document.getElementById ('ID'). Value = q + y + z + k; & Lt; / Script & gt;
create oracle sequence
create sequence table_name_seq;
and enter the ID before the INSERT trigger
Start table_name_Ri to create a trigger on table_name before INSERT for each line (TO_CHAR (SYSDATE, 'YYYYMMDD') || table_name_seq.NEXTVAL): Dual to NEW.id; End;
No comments:
Post a Comment