Amarorafael,
Não conheço muito sobre operações com campos BLOB, mas pesquisei em alguns foruns e obtive algumas informações.
Primeiro, uma descrição do erro e possíveis ações corretivas:
OCI-22275: invalid LOB locator specified
Cause: There are several causes: (1) the LOB locator was never initialized; (2) the locator is for a BFILE and the routine expects a BLOB/CLOB/NCLOB locator; (3) the locator is for a BLOB/CLOB/NCLOB and the routine expects a BFILE locator; (4) trying to update the LOB in a trigger body -- LOBs in trigger bodies are read only.
Action: For (1), initialize the LOB locator by selecting into the locator variable or by setting the LOB locator to empty. For (2) and (3), pass the correct type of locator into the routine. For (4), remove the trigger body code that updates the LOB value.
Pelo que pude entender do link citado a seguir (
http://www.orafaq.com/forum/t/50203/2/) você precisaria inicializar "LOB locator" antes de tentar manipular o LOB. O comando que você deveria utilizar neste caso seria o
DBMS_LOB.CREATETEMPORARY
. Seu código (não testei) ficaria algo parecido com :
Selecionar tudo
....
DECLARE
x_Arquivo BFILE;
x_conteudo CLOB := empty_clob;
var_dir VARCHAR2(100) := PACKAGE_NA_QUAL_PEGO_O_DIRETORIO;
BEGIN
--- Adicione esta linha ao seu código
DBMS_LOB.CREATETEMPORARY(x_conteudo,true);
x_Arquivo := bfilename(var_dir, 'EXPORT_COMPONENT_HISTORY_1349281847907.xml');
DBMS_LOB.fileOpen(x_Arquivo, dbms_lob.file_readonly);
DBMS_LOB.createtemporary(x_conteudo, TRUE, DBMS_LOB.session);
DBMS_LOB.loadFromFile(x_conteudo,x_Arquivo,DBMS_LOB.getLength(x_Arquivo),1,1);
DBMS_LOB.fileClose(x_Arquivo);
END;
...
Não saberia dizer se o código alterado acima estaria OK. Se precisar visualizar o exemplo do forum, consulte o link
http://www.orafaq.com/forum/t/50203/2/, que apresenta um exemplo de código completo.
Espero que as informações acima ajudem você a resolver seu problema.
Fique à vontade para atualizar este tópico, caso precise de alguma outra orientação.
Abraços,
Sergio Coutinho