الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعده في كوايري صغيره

مغلق
بدأه DrBaD في 10 نوفمبر 2003 · 1 رد · 948 مشاهدة · في قواعد بيانات Oracle
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله ...

شباب ممكن احد يساعدني في الكويري هده ...

perform the following query with regards to the tables available to the user SCOTT in oracle...

select a SQL query that would accept a string as a parameter, and verify that it is in the format m *n, where m, and n are alphabets.

your query should display the parameter string together with a 'y' if the string format is valid, 'n' otherwise

تم تعديل هذه المشاركة بواسطة DrBaD في 10 نوفمبر 2003 في 01:08

#2

السلام عليكم ...

شباب انا حصلت الحل هدا ...

SET SERVEROUTPUT ON

SET VERIFY OFF

declare

wstr varchar2(15) := '&1';

res varchar2(1);

begin

if length(wstr) !=3 then

DBMS_output.put_line('You Have Entered --> '||wstr||' '||'Entered Wrong Data');

return;

end if;

if ascii(substr(wstr,1,1)) between 48 and 57 then

DBMS_output.put_line('You Have Entered --> '||wstr||' '||'Entered Wrong Data');

return;

end if;

select substr(wstr,2,1) into res from dual;

if res = '*' then

DBMS_output.put_line('You Have Entered --> '||wstr||' '||'Y');

return;

else

DBMS_output.put_line('You Have Entered --> '||wstr||' '||'N');

return;

end if;

end;

بس المشكله انه واجد معقد ...واصال ما فهمت منه شي ...

ممن احد يساعدني ويعطيني حل اسهل .... بليز شباب ابي هدا عشان اكمل الاسايمنت ... :(

ومشكورين ...

هذا الموضوع مغلق.

مواضيع مشابهة