UTL_SMTP

UTL_SMTP The UTL_SMTP package requires Jserver which can be installed by running the following scripts as SYS. CREATE OR REPLACE PROCEDURE send_mail (p_to        IN VARCHAR2, p_from      IN VARCHAR2, p_subject   IN VARCHAR2, p_message   IN VARCHAR2, p_smtp_host IN VARCHAR2, p_smtp_port IN NUMBER DEFAULT 25) AS l_mail_conn   UTL_SMTP.connection; BEGIN l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port); UTL_SMTP.helo(l_mail_conn, p_smtp_host); UTL_SMTP.mail(l_mail_conn, p_from); UTL_SMTP.rcpt(l_mail_conn,… Continue reading UTL_SMTP

UTL_FILE

UTL_FILE DECLARE V1 VARCHAR2(32767); F1 UTL_FILE.FILE_TYPE; BEGIN — In this example MAX_LINESIZE is less than GET_LINE’s length request — so the number of bytes returned will be 256 or less if a line terminator is seen. F1 := UTL_FILE.FOPEN(‘MYDIR’,’MYFILE’,’R’,256); UTL_FILE.GET_LINE(F1,V1,32767); UTL_FILE.FCLOSE(F1); — In this example, FOPEN’s MAX_LINESIZE is NULL and defaults to 1024, — so… Continue reading UTL_FILE

EXPLAIN PLAN

EXPLAIN PLAN Query optimization diagram   Executing explain plan   Explain plan for select * from employee;   SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());   Reading explain plan   https://docs.oracle.com/cd/B28359_01/server.111/b28274/optimops.htm   ———————————————————————————– | Id  | Operation                     |  Name        | Rows  | Bytes | Cost (%CPU)| ———————————————————————————– |   0 | SELECT STATEMENT              |              |     3 |   189 |   … Continue reading EXPLAIN PLAN