بتاريخ: 5 أغسطس 200619 سنة comment_75840 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 fieldsal , var are variablesthe problem is when the salary field doesnt contain dataso if there any way to check if the select statement doesn't return any result and replace its value with 0 like nvl functionthanx تقديم بلاغ
بتاريخ: 6 أغسطس 200619 سنة comment_75854 السلام عليكم و رحمة الله و بركاتةيا ahmedmax انت حليتها بنفسكجربselect Nvl(sum(salary), 0) into sal from employees where emp_no = :empno;sal := sal +var;و لو ما اشتغلتش لقدر الله قولى نجرب حاجة تانى تقديم بلاغ
بتاريخ: 6 أغسطس 200619 سنة comment_75886 جرب الحل دهselect sum(salary) into sal from employees where emp_no = :empno;sal := nvl(sal,0) +nvl(var,0); تقديم بلاغ
بتاريخ: 6 أغسطس 200619 سنة كاتب الموضوع comment_75892 hi ashraffaroukI already triedselect Nvl(sum(salary), 0)but it failed because the table is emptyI want a way to check if the table already have tuples or notthanx in advance تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.