بتاريخ: 26 يونيو 201214 سنة comment_225837 انا عندي حقل اسمة cont_type من نوع char فيه بيانات انواع عقود يعني 1 و 2 و 3 لكن اللي في هذا الحقل بس ارقام يعني 1 و2 و3 انا ابغى يحط في حقل ثاني تم اضافته الى الجدول واسمه cont_type_name من نوع char اسماء هذه الانواع يعني اذا كان في الحقل الاول 1 يحط في الثاني كلمة مزايدة واذا كان 2 يحط في الثاني كلمة مباشرة وهكذا مرورا بكل قواعد البياناتفقمت بعمل هذا الكود بس يظهر لي خطأ declare cont_t varchar2(100); begin cursor c is select cont_type from new_building_test1 where file_no=file_no begin open c; loop fetch c into cont_t if cont_type=1 then update new_building_test1 set cont_type_name='مزايدة' where new_build_test1.file_no=c.file_no else if cont_type=2 then update new_building_test1 set cont_type_name='مباشرة' where new_build_test1.file_no=c.file_no else if cont_type=3 then update new_building_test1 set cont_type_name='أخرى' where new_build_test1.file_no=c.file_no end if --where new_build_test1.file_no=c.file_no; end loop; close c; end; تقديم بلاغ
بتاريخ: 26 يونيو 201214 سنة comment_225844 السلام عليكمجرب هذا الكود: Declare Cont_T Varchar2(100); Begin Cursor C Is Select Cont_Type From New_Building_Test1 Where File_No=File_No Begin Open C; Loop Fetch C Into Cont_T; If Cont_Type=1 Then Update New_Building_Test1 Set Cont_Type_Name='مزايدة' Where New_Build_Test1.File_No=C.File_No; ElsIf Cont_Type=2 Then Update New_Building_Test1 Set Cont_Type_Name='مباشرة' Where New_Build_Test1.File_No=C.File_No; ElsIf Cont_Type=3 Then Update New_Building_Test1 Set Cont_Type_Name='أخرى' Where New_Build_Test1.File_No=C.File_No; End If --Where New_Build_Test1.File_No=C.File_No; End Loop; Close C; End; وان استمر الخطأ يرجى كتابة رقم الخطأ! تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.