Let’s take a look at PL/SQL Character String Functions
• SUBSTR: extracts a specific number of characters from a string, starting at a given point
extracted_string :=
SUBSTR(string_being_searched,
starting_point,
number_of_characters_to_extract);
s_first_name := SUBSTR(‘Sarah Miller’, 1,5);
Debugging PL/SQL Programs
• Syntax error
• Does not follow language guidelines
• Causes a PLS- compile error
• Examples: misspelling a reserved word, using a function incorrectly
• Logic error
• Program compiles correctly, but does not give correct output
Locating and Correcting Syntax Errors
• Isolate the line that is causing the error
• This may be before or after the line that is flagged by the compiler
• Comment out lines as necessary until program runs
• One error may cause several cascading errors, so re-run program after fixing each error
Leave a comment