Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Posts
    227

    Unanswered: max size of characters in pl/sql

    Hi,
    I tried to send in mail (utl_smtp) more 32767 characters but I get error:

    text varchar2(32767);

    I tried also "long" but I get same error

    Exist a datatype more 32767 characters??

    with clob, blob, nlob I get error.


    Thanks
    Raf

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Well if mail cant take more than 32K why not check the length of text so when adding one more item will take it over 32K then send the email and create a new email resetting text to an empty string.

    Alan

  3. #3
    Join Date
    Jul 2002
    Posts
    227
    Originally posted by AlanP
    Well if mail cant take more than 32K why not check the length of text so when adding one more item will take it over 32K then send the email and create a new email resetting text to an empty string.

    Alan
    Alan I don't understanding how can I reset text to an empty string.

    my procedure is this:

    CREATE OR REPLACE procedure send_mail ( mitt IN varchar2,
    destinatario1 IN varchar2,
    object IN varchar2,
    messagge IN varchar2) IS
    cursor my_cur is
    select text
    from my_tab;
    mailhost varchar2(40):= 'pop3.cxx.yyyyyyyyy';
    conn utl_smtp.connection;
    crlf varchar2(2):=CHR(13)||CHR(10);
    messag long; --varchar2(3000);
    v_mitt varchar2(2000) := mitt;
    BEGIN
    conn := utl_smtp.open_connection (mailhost, 25);
    messag := 'DATE: '||to_char(sysdate, 'dd-mon-yy hh24:mi:ss')||crlf||
    'FROM: <'||mitt||'>'||crlf||
    'SUBJECT: '||object||crlf||
    'TO: '||destinatario1;
    for rec_msg in my_cur
    loop
    messag := messag||chr(10)||rec_msg.text;
    end loop;
    utl_smtp.helo(conn, mailhost);
    utl_smtp.mail (conn, v_mitt);
    utl_smtp.rcpt (conn, destinatario1);
    utl_smtp.data(conn, messag);
    utl_smtp.quit(conn);
    end send_mail;


    How can I do it?

    Thanks
    Raf

  4. #4
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Change your loop so that it sends multiple emails i.e when message is full in that adding one more item will take it over 32K then send the email, set message to a blank string and start over again.

    Alan

  5. #5
    Join Date
    Jul 2002
    Posts
    227
    Originally posted by AlanP
    Change your loop so that it sends multiple emails i.e when message is full in that adding one more item will take it over 32K then send the email, set message to a blank string and start over again.

    Alan
    How can I change the loop in my specific example???


    Raf

Posting Permissions

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