الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

مشكلة في الفانكشن أرجو المساعدة

Featured Replies

بتاريخ:

السلام عليكم أنا أعاني من مشكلة في الفانكشن حيث قمت بعملها على مستوى ENTERPRISE MANAGER حيث استعملت raise_application_error(-20001,'TEXT')، المشكلة عندما استعملها في الفورمز يظهر لي ORA-20001 NON TRAITER أرجو منكم المساعدة

بتاريخ:

تقدر لو تكرمت ترسل الfunction كاملة؟

بتاريخ:
  • كاتب الموضوع

function (m in number, e i date) return is date
select nom into n from personne
where m=mat
exception when others then raise_application_error(-2001,'Cette enregistrement n''existe pas');
end;

بتاريخ:

function (m in number, e i date) return is date
select nom into n from personne
where m=mat
exception when others then raise_application_error(-2001,'Cette enregistrement n''existe pas');
end;


أخي الحبيب

واضح من الفنكشن انها معموله علي الفورم مش علي الداتا بيز ولا كانت علي قاعدة البيانات كنت كتبت
create function

وبما أنها علي علي الفورم فلا يتأتي معها
exception when others then raise_application_error(-2001,'Cette enregistrement n''existe pas');

وعلي الفورم ممكن
exception when others then message(-2001,'Cette enregistrement n''existe pas');


أما اذا كانت الفنكشن تقصد أنها علي قاعدة البيانات وليس علي الفورم

حاول مره ثانية بتصحيح الكود حيث توجد لديك أخطاء من ضمنها
1- اسم الفنكشن غير موجود
2-المتغير الذي تعرف داخله ايضا غير موجود وهو N
3- انت عامل الفنكشن ترجع تاريخ رغم ان num باين عليه رقم مش تاريخ
4-لم تقم بعمل return للمتغير
5- where m=mat يجب ان تكون where m='mat'

واليك الكود بعد التعديل


Craete or replace function xx
return number is
n personne.nom%type;
begin
select nom into n from personne
where m='mat';
return(n);
exception when others then raise_application_error(-2001,'Cette enregistrement n''existe pas');
end;



وممكن تطورها بدل where = قيمة ثانته كالتالي

Craete or replace function xx(p_name in varchar2)
return number is
n personne.nom%type;
begin
select nom into n from personne
where m=p_name;
return(n);
exception 
when others then raise_application_error(-2001,'Cette enregistrement n''existe pas');
end;



مثال اخر


create or replace function Get_emp_name(p_empno emp.empno%type) return varchar2
is
l_ename emp.ename%type;
l_result emp.ename%type;
begin
if p_empno is null Then
raise_application_error(-20001,'لم يتم العثور على رقم الموظف');
end if;
select ename into l_ename
from emp
where empno =p_empno;
return l_ename;
Exception
when others then
raise_application_error(-20001,'Error in get_Emp_name :' || sqlerrm);
end;


بالتوفيق

بتاريخ:
  • كاتب الموضوع

بارك الله فيك أخي العزيز سوف أعمل بهذا الكود وسيعمل ان شاء الله وسوف تلقى الرد شكرا

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

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

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

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

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

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.