oracle8.1.6
select 1
from dual
where exists (select name
from cr_items
where parent_id = :parent_folder_id
and name = :encoded_filename)
begin
:1 := file_storage.new_file (
item_id => :file_id,
title => :encoded_filename,
folder_id => :parent_folder_id,
creation_user => :user_id,
creation_ip => :creation_ip,
package_id => :package_id,
indb_p => :indb_p
);
end;
begin
:1 := file_storage.new_version (
filename => :title,
description => :description,
mime_type => :mime_type,
item_id => :file_id,
creation_user => :user_id,
creation_ip => :creation_ip
);
end;
update cr_revisions
set content = empty_blob()
where revision_id = :revision_id
returning content into :1
update cr_revisions
set content_length = dbms_lob.getlength(content)
where revision_id = :revision_id
begin
:1 := content_item.relate(
item_id => :homework_file_id,
object_id => :correction_file_id,
relation_tag => 'homework_correction'
);
end;