4.1 compile a debug package (routine)
Create or replace package yang_debug
Procedure out (p_comments in varchar2, p_varible in varchar2 );
Procedure erase;
End yang_debug;
Create or replace package body yang_debug
Procedure out (p_comments in varchar2, p_varible in varchar2) is
L_file utl_file.file_type;
Begin
Rochelle file: = utl_file.fopen ('d:/test', 'debug. log', 'A ');
Utl_file.put_line (l_file, to_char (sysdate, 'yyyy-mm-dd 24hh: mm: ss') |
', Comment:' | p_comments | ', Varible:' | p_varible );
Utl_file.fclose (l_file );
Exception
When others then
Dbms_output.put_line ('error: '| to_char (sqlcode) | sqlerrm );
NULL;
End out;
Procedure erase is
L_file utl_file.file_type;
Begin
Rochelle file: = utl_file.fopen ('d:/test', 'debug. log', 'w ');
Utl_file.fclose (l_file );
Exception
When others then
Dbms_output.put_line ('error: '| to_char (sqlcode) | sqlerrm );
NULL;
End erase;
End yang_debug;
/
4.2 call a function
Create or replace procedure assert (
Condition in Boolean,
Message in varchar2)
Begin
If not condition then
Raise_aaplication_error (-20000, message );
End if;
End assert;
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