Oracle Stored Procedure debugging method

Source: Internet
Author: User

The Oracle stored procedure can be debugged and modified as needed. The following describes how to modify an Oracle Stored Procedure for your reference.

If you want to execute the Oracle stored procedure, you first need to write a "Hello World!" output string !" The following describes the steps of Oracle storage.

Let's write an output string "Hello World !" Use Notepad to open your skeleton. SQL file. Use DBMS_OUTPUT.PUT_LINE to replace the NULL statement, as shown below:

Create or replace procedure skeleton is begin DBMS_OUTPUT.PUT_LINE ('Hello World! '); END;
Save to the file skeleton. SQL.

Open the file skeleton. SQL from the SQL * Plus command line.

SQL> @ skeleton SQL> CREATE OR REPLACE PROCEDURE skeleton IS BEGIN DBMS_OUTPUT.PUT_LINE ('Hello World! '); * END; SQL>/

SQL * Plus notifies you That the stored Procedure is successfully created and the prompt message is displayed: Procedure created.

SQL>

Run your stored procedure with the EXECUTE command:

SQL> EXECUTE skeleton;
SQL * Plus shows that the stored procedure runs successfully:

PL/SQL procedure successfully completed.

The output string "Hello World! "Failed. Run a SET command before displaying a DBMS_OUTPUT.PUT_LINE result. At the SQL * Plus command line prompt, type:

SQL> SET SERVEROUTPUT ON
Execute your stored procedure again:

SQL> EXECUTE skeleton;
Now the result is output:

Hello World! PL/SQL procedure successfully completed.
When debugging a stored procedure, follow the same steps to modify the SQL file, create a stored procedure, execute the stored procedure, and modify the error information according to the compiler feedback. This step is very tedious, it depends on experience.

In the development and debugging process of the actual commercial storage process, complex logics such as tables, types, cursors, loops, and conditions are involved, and flexible use of PL/SQL statements, during compilation, a lot of error messages will be generated. The programmer can locate and correct the errors Based on the errors, and then compile the statements to get the correct structure;


 

Online redo Oracle Log File Size

How to delete ORACLE archive logs

Oracle mobile data file Method

Oracle Log File Reconstruction Method

How to modify the oracle user name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.