-
Notifications
You must be signed in to change notification settings - Fork 0
/
Samples.sql
49 lines (40 loc) · 1.58 KB
/
Samples.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---------------------Samples---------------------
BEGIN
PKG_SEND_MAIL.SEND_MAIL('[email protected]','[email protected]','test','test');
END;
-----------------------------------------------
BEGIN
PKG_SEND_MAIL.SEND_MAIL('[email protected]','[email protected]','test',
'<TITLE>10/01/2013 09:30:28</TITLE><H3 ALIGN="CENTER">My header</H3>' ||
'<TABLE BORDER=1 ALIGN="CENTER" CELLPADDING=0><TR><TD ALIGN="CENTER">Simple Table</TD></TR></TABLE>',
NULL,'text/html');
END;
-----------------------------------------------
DECLARE
attachments PKG_SEND_MAIL.ARRAY_ATTACHMENTS := PKG_SEND_MAIL.ARRAY_ATTACHMENTS();
BEGIN
attachments.extend(3);
FOR i IN 1..3
LOOP
SELECT 'test' || to_char(i) || '.txt','text/plain','test' || to_char(i)
INTO attachments(i)
FROM dual;
END LOOP;
PKG_SEND_MAIL.SEND_MAIL('[email protected]','[email protected]','test','test',attachments);
END;
-----------------------------------------------
DECLARE
attachments PKG_SEND_MAIL.ARRAY_ATTACHMENTS := PKG_SEND_MAIL.ARRAY_ATTACHMENTS();
BEGIN
attachments.extend(3);
FOR i IN 1..3
LOOP
SELECT 'test' || to_char(i) || '.xls','text/plain',
'<TITLE>10/01/2013 09:30:28</TITLE><H3 ALIGN="CENTER">My header</H3>' ||
'<TABLE BORDER=1 ALIGN="CENTER" CELLPADDING=0><TR><TD ALIGN="CENTER">Simple Table</TD></TR></TABLE>'
INTO attachments(i)
FROM dual;
END LOOP;
PKG_SEND_MAIL.SEND_MAIL('[email protected]','[email protected]','test','test',attachments);
END;
-----------------------------------------------