hai friends,

I have a two filed table
ex. DEPT is my table name, deptno and dname are my fields.

So, my problem is, while i am inserting dname only,
then, the deptno has to generate automatically. (without using
any front ends like D2k,VB etc).
So, I wrote a trigger before insert(generate deptno + 1), but it is failed, giving the message "recursive"etc while inserting.

I wrote after inserting, then the message is mutating.

So, I want, while entering dname the deptno is automatically
generated,

So, can u pleae suggest me how can I solve this problem.

Thank u very much.