Home » SQL & PL/SQL » SQL & PL/SQL » SEND Query Output By email
icon14.gif  SEND Query Output By email [message #306818] Mon, 17 March 2008 00:19 Go to next message
jnchopra
Messages: 3
Registered: March 2008
Location: THAILAND
Junior Member
I want to send my Query result by email
below is my script
CURSOR C1 IS
SELECT I.INDENT_SEQ_NO,I.INDENT_ITEM_CODE,I.ITEM_NAME,I.ITEM_UM,I.INDENT_ITEM_QTY,I.APPROX_ITEM_RATE,I.REQUIRED_BY_DATE,I.TO_USE_WITHIN_DAYS
FROM INDENT_ITEMS I
WHERE I.PARENT_RECID = 4555260;
begin

EMAIL_ALERTS.Send_Email('jnchopra@gmail.com,
'Subject: Testing',
'<html>
<head>
<title>Oracle Techniques By Sameer Wadhwa</title>
</head>
<body bgcolor="#FFFFFF" link="#000080">
<table cellspacing="0" cellpadding="0" width="100%">
<tr align="LEFT" valign="BASELINE">
<td width="100%" valign="middle"><h1><font color="#00008B"><b>Send Mail FOR APPROVAL Format</b></font></h1>
</td>
</table>

<table cellspacing="0" cellpadding="0" width="100%">
<tr align="LEFT" valign="BASELINE">
<td width="100%" valign="middle"><h1><font color="#00008B"><b>Send Mail FOR APPROVAL Format</b></font></h1>
</td>

</table>
<ul>
<li><b><a href="http://192.168.1.2:8888/dev60cgi/ifcgi60.exe?config=approval">APPROVE </li>
<l><b> </b> </l>
</ul>
</body>
</html>'
);
END LOOP;
end;

above code work fine and send me cursor out put by email but if i have 5 records then it send me 5 email
i wants all in single email
please help
Re: SEND Query Output By email [message #306826 is a reply to message #306818] Mon, 17 March 2008 00:44 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
The script you posted does not send you an email, let alone 5. The code is invalid. (end loop without a start of the loop)

Please read the forum rules about formatting your post and about when to post in the expert forums.
Re: SEND Query Output By email [message #306837 is a reply to message #306826] Mon, 17 March 2008 01:31 Go to previous messageGo to next message
jnchopra
Messages: 3
Registered: March 2008
Location: THAILAND
Junior Member
YES I FORGOT TO TYPE START LOOP

DECLARE
CURSOR C1 IS
SELECT SEQ_NO,ITEM_CODE,NAME
FROM INDENTS I
WHERE INDENT_ID = '00000';
BEGIN

FOR R1 IN C1 LOOP
EMAIL_ALERTS.Send_Email('jnchopra@gmail.com',
'Subject:Testing',
'<html>
<head>
<title>Oracle Techniques By Jaydeep Chopra</title>
</head>
<body bgcolor="#FFFFFF" link="#000080">
<table cellspacing="0" cellpadding="0" width="100%">
<tr align="LEFT" valign="BASELINE">
<td width="60%" valign="middle"><h1><font color="#00008B">
<b>"Indent No -'|| R2.INDENT_SEQ_NO||'/'||R2.INDENT_ITEM_CODE||'- "</b></font></h1>
</td>
</table>
<ul>
<li>
<b><a href="http://192.168.1.2:8888/dev60cgi/ifcgi60.exe? config=approval">APPROVE </li>
<l><b> </b> </l>
</ul>
</body>
</html>',
EMAIL_ALERTS.GET_SENDER_MAIL_ADDRESS(n.COMPANY));

END LOOP;
END;

=======================================================
need urgent help , please reply i will do formating next time befor posting

Re: SEND Query Output By email [message #306840 is a reply to message #306837] Mon, 17 March 2008 01:45 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
jnchopra wrote on Mon, 17 March 2008 07:31
need urgent help , please reply i will do formating next time befor posting



So you knew you were posting against the guidelines and yet you did not bother to comply.
Well, I will help you next time!
Re: SEND Query Output By email [message #306845 is a reply to message #306837] Mon, 17 March 2008 01:49 Go to previous messageGo to next message
madasamy
Messages: 4
Registered: February 2008
Location: Chennai
Junior Member
hey i need hw to send mail through pl/sql form and reports...
Re: SEND Query Output By email [message #306848 is a reply to message #306840] Mon, 17 March 2008 01:53 Go to previous message
jnchopra
Messages: 3
Registered: March 2008
Location: THAILAND
Junior Member
Frank
i didnt post againts your policy,
but i may did it by mistak, dont take it much serious
your urgent help will appriacte
thanks in advance
regards
Jay
Previous Topic: PLS-00201: identifier 'TO_NCHAR' must be declared
Next Topic: Number to Bit Function
Goto Forum:
  


Current Time: Sun Dec 04 18:57:51 CST 2016

Total time taken to generate the page: 0.04702 seconds