Ich habe eine Prozedur, die eine BLOB-Variable mit einem PDF-Dokument auffüllt. Was ich versuche, ist Logik hinzuzufügen, um das PDF-Dokument nur innerhalb eines Zeitraums von 60 Tagen ab einem statischen Datum anzuzeigen. Siehe unten:ORA-22275 Fehler: ungültig LOB-Locator angegeben
check_staticdate number(1);
function DisplayPDF (audit in number) RETURN blob is
person_id person.person_id%type;
z_lob blob;
blob_length NUMBER;
CURSOR getPDF(audit number) IS
select report
from report_table
where report_type = 'PDF'
and job_no = audit order by rec_no;
begin
/* Check Valid ID */
if not package.ValidID(person_id, check_only=>TRUE) then
return z_lob;
end if;
/* Here is the case statement.*/
select case
when exists
(
SELECT 'x' from table
where table_id = person_id
and trunc(sysdate) < trunc(table_static_date + 60)
)
then 1
else 0
end into check_staticdate
from dual;
if (check_staticdate = 0) then
return z_lob;
end if;
open getPDF(audit);
fetch getPDF into z_lob;
close getPDF;
return z_lob;
end DisplayPDF;
Der Fehler Ich erhalte ist: ORA-22275: invalid LOB locator specified.
Ich bin neu in Oracle SQL und bin nicht sicher, warum meine ValidID Check Werke von z_lob Rückkehr aber mein Fall Aussage nicht der Fall ist.
Edit: Hinzufügen voller Fehler-Stack
Failed to execute target procedure ORA-22275: invalid LOB locator specified
ORA-06512: at "SYS.WPG_DOCLOAD", line 51
ORA-06512: at "User.Package", line 733
ORA-06512: at line 33
ich Sie sicher, bekam dafür Kredit machen wollte. Dies wurde neu zugewiesen und neu priorisiert. Ihre Antwort hat jedoch letztendlich funktioniert. Vielen Dank! – Phoenix
Zusammen mit 'DBMS_LOB.OPEN', wie das - ' DBMS_LOB.CREATETEMPORARY ( lob_loc => z_lob , cache => true , dur => dbms_lob.call); DBMS_LOB.OPEN ( lob_loc => z_lob , open_mode => DBMS_LOB.LOB_READWRITE); ' - und es funktioniert. – PhistucK