In access or sql server, you can use autonumber which is automatically generated as soon as an insert statement is invoked.
Does anyone know how I can use this in oracle without the benefit of a stored procedure?
For instance, I need to have a sequence number which not only assigns numbers but also increments whenever a record is created.
Example, I need to do an insert like
strSql = "INSERT INTO mytable(id, name,city,state)"
strSql = strSql & " VALUES ("
strSql = strSql & "'" & id_seq.nextval & "',"
strSql = strSql & "'" & name & "',"
strSql = strSql & "'" & city & "',"
strSql = strSql & "'" & state & "'"
strSql = strSql & ""
Notice the id_seq.nextval. It is not working.
The only way I know how to use it in asp is to use a stored procedure but I don't want to use a stored proc because I am having problem with it and I have a short time to complete this task.
Does anyone know how I can use this in oracle without the benefit of a stored procedure?
For instance, I need to have a sequence number which not only assigns numbers but also increments whenever a record is created.
Example, I need to do an insert like
strSql = "INSERT INTO mytable(id, name,city,state)"
strSql = strSql & " VALUES ("
strSql = strSql & "'" & id_seq.nextval & "',"
strSql = strSql & "'" & name & "',"
strSql = strSql & "'" & city & "',"
strSql = strSql & "'" & state & "'"
strSql = strSql & ""
Notice the id_seq.nextval. It is not working.
The only way I know how to use it in asp is to use a stored procedure but I don't want to use a stored proc because I am having problem with it and I have a short time to complete this task.