بتاريخ: 9 مارس 200718 سنة comment_93558 بسم الله الرحمن الرحيم سوف ابدا سلسله شرح لل plsql الدرس الاول PL/SQL STRUCTURE - Block Structure Pl SQL program are divided up into structures know as blocks, with each block containing Pl SQL and SQL statements The typical PL SQL block has the following structure. Declare -- optional Declaration_statements – [ variables , constant , user defined exceptions , cursors ] Begin -- mandatory [sql statements , PL SQL statements ] Exception -- optional [ Actions to perform when errors occur ] End ; -- mandatory Every statement is terminated by a semicolon ; And block is terminated using the END keyword - Type of variables PL SQL Variables: Scalar Such as [ number , varchar2 , Boolean , date ] Composite Record that contain variables such as [ number , date ] Reference Large objects lob Non-PL SQL Variables: [ Bind variables , Host variables ] - Identifier variables in PL SQL Identifier ( constant ) data type ( not null ) [ : = / default expression ] Or Using % type attributes - Block Structure Types: Anonymous block -- Dose not have a name Subprograms Such as [ procedure , Function , trigger ] - Anonymous block examples 1- Display and Retrieve data Select Column Names Into [ variables , records name ] From table name Where [ condition ] Example: Declare V_ID emp.empno%type; V_Name emp.ename%type; V_Sal emp.sal%type; Begin Select Empno,Ename,Sal Into v_Id,V_Name,V_sal From EMP Where Empno=7788; dbms_output.put_line(v_id||' ' ||v_Name|| ' ' ||To_Char(V_Sal)); End; 2- Insert case Begin Insert Into Emp ( empno , Ename) Values ( 200,'islam'); End; Or Declare V_empno emp.empno%type:=&no; V_ename emp.ename%type:='&name'; Begin Insert Into Emp ( empno , Ename) Values (v_empno,V_ename); End; 3- Update case Declare V_sal_increase emp.sal%type:=&sal; Begin Update emp Set sal=sal+v_sal_increase Where empno=7788; End; 4- Delete case Declare V_id emp.empno%type:=&no; Begin Delete from emp Where empno=v_id; End; تقديم بلاغ
بتاريخ: 9 مايو 200718 سنة comment_99348 مشكور يا أخي على المعلومات القيمةوإلى الأمام يا أخي ......... تقديم بلاغ
بتاريخ: 10 يوليو 200718 سنة comment_104525 جزاك الله خيرا ........................جزاك الله خيرا ........................جزاك الله خيرا ........................جزاك الله خيرا ........................جزاك الله خيرا ........................جزاك الله خيرا ........................ تقديم بلاغ
بتاريخ: 12 يوليو 200718 سنة comment_104713 أخي الكريم ، آسف جداً علي التأخير ، وألف ألف مبروكفعلاً من صبر علي شيء وفقة اله عز وجل تقديم بلاغ
بتاريخ: 5 أبريل 200817 سنة comment_126080 الاخ Fabled Warrior مشكور على جهودك القيمة ولي طلب اذا ممكن تعطينا توضيح بالعربي لكل برنامج اي شرح وتوضيح الفكرة التي يقوم بها تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.