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

if exist in pl/sql


ahmedmax

Recommended Posts

I want to create a pl/sql procedure that perform summary function on som feild in the database then add to a variable
something like

select sum(salary) into sal from employees where emp_no = :empno;
sal := sal +var;



salary is database field
sal , var are variables

the problem is when the salary field doesnt contain data
so if there any way to check if the select statement doesn't return any
result and replace its value with 0 like nvl function

thanx

تم تعديل بواسطة ahmedmax
رابط هذا التعليق
شارك

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

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

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

×   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.

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

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

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