Disonnecting from database
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Disonnecting from database

  1. #1
    Join Date
    Apr 2009
    Posts
    8

    Disonnecting from database

    Hi all

    I have created a procedure to send mail, using utl_smtp package. the code goes like this

    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\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

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Most likely you have a syntax error; hard to say 'cause you are not showing your code and you are not actually copy/pasting the error stack. It doesn't say varcahr2, does it?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,002
    Quote Originally Posted by PAVB View Post
    Most likely you have a syntax error; hard to say 'cause you are not showing your code and you are not actually copy/pasting the error stack. It doesn't say varcahr2, does it?
    Syntax error seems likely unless he has a stored type called varcahr2...
    this space intentionally left blank

  4. #4
    Join Date
    Apr 2009
    Posts
    8
    thanks buddies

    varcahr is typographical error. that was an accident

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width