473,473 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Disconnecting from database automatically

151 New Member
Hi all

I have created a procedure to send mail, using utl_smtp package. the code goes like this
Expand|Select|Wrap|Line Numbers
  1. create or replace procedure send_mail(parma1 In date,param2 in date)
  2. is
  3. email varchar2(100);
  4. subject varchar2(100);
  5. conn utl_smtp.connection;
  6. begin
  7.  
  8. capture the email id from some table;
  9. con = utl_smtp.connection (host,25);
  10. utl_smtp.helo(conn, host)
  11. utl_smtp.mail(conn,email)
  12.  
  13. utl_smtp.open_data(conn)
  14. .
  15. .
  16. .
  17. .
  18. end;
  19.  
I execut this procedure in the following way
SQL:> @c:\scripts\send_mail.sql;

wher send_mail is the .sql file of the above code.

I get the following error and i am disconnected from the data base.


SQL:> @c:\scripts\send_mail.sql;

Unknown command at the beginning email varcahr2 .... rest of the line ignored
Unknown command at the beginning subject varcahr2 .... rest of the line ignored

ORA-12203 -TNS: unable to conect to destination

Warning: You are no longer connected to Oracle
Not Connected
SQL>



What might be the reason? This is happening for this procedure only. I was able to compile many before this.

vamsi
Apr 24 '09 #1
1 3146
debasisdas
8,127 Recognized Expert Expert
Your file contains the code of the procedure of the calling of the procedure with parameters ?
Apr 27 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: phoenix | last post by:
Hi, i'm using a dsl connection to surf the internet. I use the following code to connect to the internet : // Check if already connected if (InternetAttemptConnect(0) != 0) return false;...
1
by: OliP | last post by:
Hello, I have an application and BD.mdb (Access97) on the server (Windows2003 EE) with fifteen workstations (Win2k & WinXP), which run the application by mapping the share on the server. The...
2
by: cmd | last post by:
I use a utility database and the following code to link from an original backend to a temporary backend, in order to replace the original with a newer version: Dim dbs As Database Dim tdf As...
7
by: Andreas Håkansson | last post by:
Hello, I'm building a small TCP based server which uses the Async commands. When a new connection is made to the server, I store the new socket in a hashtable, using the client IP as the key. ...
13
by: Joner | last post by:
Hello, I'm having trouble with a little programme of mine where I connect to an access database. It seems to connect fine, and disconnect fine, but then after it won't reconnect, I get the error...
1
by: salvagedog | last post by:
We use xp_smtp_sendmail for all emailing from SQL Server. Occasionally it fails, generating the following message: Error: disconnecting from server mail.mydomain.com failed The failures are...
1
by: Rahul B | last post by:
Hi, I have a situation where many people will be connecting to DB2 through various clients and applications. Since people just connect to the Database through a client and leave it as it is,...
3
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi All, I have a ASP/C# application that connect to Oracle database . After issuing my SQL query if I close the browser or move into another page ( ie whle executing in the databse serevr) will...
1
LMHelper
by: LMHelper | last post by:
Ok I am creating a new database for LM. One that will keep track of our licenses for over 400 users. We already have a database with the users information like name, location, telephone number,...
0
by: mchirouze | last post by:
Hi, I have been working on this piece of code which lists all tables in a MS Access database (including linked tables) and converts them to a DataTable with a pre-defined format. I use ADOX and...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.