- Este tópico contém 1 resposta, 2 vozes e foi atualizado pela última vez 17 anos, 7 meses atrás por DanielB.
-
AutorPosts
-
2 de julho de 2007 às 3:20 pm #79906PhricioliParticipante
😥
Pessoal , preciso de uma ajuda preciso enviar email pelo Oracle com anexo, buscando em um diretório Windows, até ai tudo bem…
O problema que ao rodar a procedure caso o anexo seja maior que 1mb acontece o erro.ja tentei com o UTL_MAIL.Send_Attach_Varchar etc
Alguém poderia me dar uma dica ? Arquivos pequenos são enviados normalmente como anexo..
Fico no aguardo dos companheiros..ORA-06502: PL/SQL: numeric or value error: raw variable length too long
ORA-06512: at “SYS.UTL_ENCODE”, line 243
ORA-06512: at “SYS.UTL_MAIL”, line 133
ORA-06512: at “SYS.UTL_MAIL”, line 576
ORA-06512: at “SYS.UTL_MAIL”, line 666
ORA-06512: at “ATOPROT.ENVIA_MAIL”, line 16
ORA-06512: at line 1CREATE OR REPLACE function envia_mail( pRemetente in VarChar2,
pDestinatario in VarChar2,
pArquivo in VarChar2,
pAssunto in VarChar2,
pTexto in VarChar2,
pCcopia in VarChar2 default null )
Return Integer
Is
fHandle UTL_FILE.FILE_TYPE ;
rConteudo RAW( 32767 ) ;
Begin
— Abre o arquivo para leitura em bytes -> ‘rb’
fHandle := UTL_FILE.FOpen( ‘diremail’ , pArquivo, ‘rb’ ) ;
UTL_FILE.Get_Raw( fHandle, rConteudo ) ;
UTL_FILE.FClose( fHandle ) ;
UTL_MAIL.Send_Attach_Raw(
sender => pRemetente,
recipients => pDestinatario,
cc => pCcopia,
subject => pAssunto,
message => pTexto,
attachment => rConteudo,
att_filename => pArquivo
) ;
Return( 1 ) ;
–Exception
— When Others Then
— Raise_Application_Error( -20101, ‘Arquivo Invalido, ou nao existe.’ ) ;
End ;
/3 de julho de 2007 às 4:09 am #79913DanielBParticipanteSymptomsIf the size of the attachment using UTL_MAIL.SEND_ATTACH_RAW exceeding 32767 Bytes it gives the following errors:
ORA-06525: Length Mismatch for CHAR or RAW data
ORA-06512: at “SYS.UTL_FILE”, line 119
ORA-06512: at “SYS.UTL_FILE”, line 1100
ORA-06512: at “PACKAGE.PROCEDURE”, line 15
ORA-06512: at line 1When using UTL_MAIL.SEND_ATTACH_RAW with attaching a file which is less than 32767 bytes, it sends the mail successfully.
Cause
UTL_MAIL.SEND_ATTACH_RAW requires a RAW as a parameter. Maximum size for RAW is 32K.Solution
Use UTL_SMTP to utilize attachments larger then 32K -
AutorPosts
- Você deve fazer login para responder a este tópico.