Teach Yourself PL/SQL in 21 Days- P9

Teach Yourself PL/SQL in 21 Days- P9: Welcome to Sams Teach Yourself PL/SQL in 21 Days, Second Edition. The fact that you purchased this book indicates that you have an interest in learning the PL/SQL language, which is Oracle’s relational database procedural programming language. It allows you to develop powerful and complex programs to access and manipulate data in the Oracle8i database. We have attempted to include as many examples of PL/SQL code as possible to illustrate PL/SQL features | Debugging Your Code and Preventing Errors 377 I Input 1 2 3 4 5 6 7 8 9 10 11 12 13 14 DECLARE v_MyChar VARCHAR2 20 test1 v_NUMBER NUMBER v_Date DATE SYSDATE v_counter INTEGER BEGIN This is a Test1 Of Syntax Error Debugging1 For v_COUNTER IN LOOP You are in loop i v_counter END LOOP END Output This is a Test Of Syntax Error Debugging You are in loop 1 You are in loop 2 You are in loop 3 You are in loop 4 You are in loop 5 PL SQL procedure successfully completed. Finally you get some good results. The purpose of this example is to demonstrate the following One syntax error sometimes masks others. Fixing that one will bring the others to light. The line number that Oracle flags as containing the error might not necessarily be the location of the true error. Taking the time to type in your code carefully saves a lot of time during program testing. You can see from the number of iterations that we went through with this one piece of code that you can save a lot of time by catching syntax errors as you write code. The next section gives you some tips to help you do just that. Preventing Syntax Errors It would be nice if it were possible to somehow prevent all syntax errors from occurring. Unfortunately you are a human being humans do make mistakes and nothing you do will ever change that. There are however some things that you can do to reduce your chances of ever writing syntax errors into your code. 13 378 Day 13 One thing you can do is become familiar with the most common types of errors. I ve found that the list of common syntax errors includes Using where belongs Leaving off the semicolon at the end of a statement Using ELSEIF when ELSIF is correct Using double quotes for strings instead of single quotes Keep these common errors in mind as you write code. Also determine what your personal list of common mistakes is and keep that in mind as well. Just the act of being consciously aware of these .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
144    321    53    29-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.