الانتقال إلى المحتوى

Assigning Sequence numbers to Records


Abu_Abd_elrahman

Recommended Posts

Al salamo 3alaykom


I wanna to Assign A sequence numbers to an item in a
Form , i tried by this method : [/align



I create a pre-insert trigger and i wrote this query

Select s_ord_id.nextval
into :s_ord.id
from dual

then i wrote this INSERT Statement
insert into Order

[align=left]Values(:s_ord.id,.............)



But it Didn't work so what is the problem is it the trigger type or what?




I don't wanna to make it by the Initial VALUE method


Waiting from u As Fast As U can :)

رابط هذا التعليق
شارك

تستطيع عمل داله تقوم بعمل ذلك

FUNCTION get_emp_id RETURN number IS
v_id number;
BEGIN
select std_id_seq.nextval
into v_id
from dual;
return v_id;
END;



وتقوم بعمل trigger من نوع pre-insert يقوم بجعل قيمة الحقل مساوية للقيمة التى ترجعها هذه الدالة

:emp.empno := get_emp_id()

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية