الانتقال إلى المحتوى
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.

كيفية اظهار تفاصيل الموظف بمجرد ادخال Empno في جدولemp

Featured Replies

بتاريخ:

لسلام عليكم
حاولت بطرق كثيره لاتوصل للحل ولم اقدر اجيده
وكتبت هذا الكود ولكن ماالخطا فيه

DECLARE
ENO NUMBER(4);
BEGIN
ENO:=&ENO;
SELECT * FROM EMP WHERE ENO=EMPNO;
end;
/


بس ماضبط معي فايش الخطا
السوال
من خلال ال PL/SQL
اريد فقط ادخال رقم الموظف EMPNO للجدول EMP وبمجرد ادخال رقم الموظف فيعطيني كل تفاصيل الموظف اي الصف كامل JOB,SAL,DEPTNO,ENAME,HIREDATE والى اخره

ولكم الجزيل الشكر

تم تعديل بواسطة abdullah_hamad

بتاريخ:

set serveroutput on
DECLARE
ENO NUMBER(4);
v_ename varchar2(20);
BEGIN
ENO:=&ENO;
SELECT ename into v_ename FROM EMP WHERE ENO=EMPNO;
end;



طبعا يحتاجلك ان تستخدم البكج dbms_output.put_line () لكي تعرض النتائج على sql*plus

بتاريخ:

alsalam alekom
as i understand quation i think that u shoud use cursor to display all employee detail
u have employee table which contain such as 5 columns so u want to see the 5 columns
name of columns is empno ,ename,sal,job,comm then can see this all columns as below

by using pl sql
ed first.sql



declare


cursor c1 is select *from emp;
er emp%rewtype;
Begin
open c1
loop
fetch c1 into er from emp where empno=en;
exit when c1%notfound;
dbms_output.put_line(er.empno||' '||er.ename ||' ' ||er.sal||' '||and so on)
end loop;
close c1;
end ;
/


go to sql and use
@first.sql



in my dbms i used and so on means remaining of columns [/u]


or u can use another way
declare
cursor c1 is select empno ,ename ,sal,job,comm from emp;
no emp.empno%type;
en emp.ename%type;
es emp.sal%type;
ej emp.job%type;
ec emp.comm%type;

Begin
open c1
loop
fetch c1 into no,en,es,ej,ec from emp where empno=no;
exit when c1%notfound;
dbms_output.put_line(er.empno||' '||er.ename ||' ' ||er.sal||' '||and so on)
end loop;
close c1;
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.