Disconnecting from database automatically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vamsioracle
    New Member
    • Jun 2007
    • 151

    Disconnecting from database automatically

    Hi all

    I have created a procedure to send mail, using utl_smtp package. the code goes like this
    Code:
    create or replace procedure send_mail(parma1 In date,param2 in date)
    is
    email varchar2(100);
    subject varchar2(100);
    conn utl_smtp.connection;
    begin
    
    capture the email id from some table;
    con = utl_smtp.connection (host,25);
    utl_smtp.helo(conn, host)
    utl_smtp.mail(conn,email)
    
    utl_smtp.open_data(conn)
    .
    .
    .
    .
    end;
    I execut this procedure in the following way
    SQL:> @c:\scripts\sen d_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\sen d_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
    Last edited by debasisdas; Apr 27 '09, 02:17 PM. Reason: added code tags
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Your file contains the code of the procedure of the calling of the procedure with parameters ?

    Comment

    Working...