postgresql7.1
select file_storage__new_file (
:title, -- title
:folder_id, -- parent_id
:user_id, -- creation_user
:creation_ip, -- creation_ip
true -- indb_p
);
select file_storage__new_file (
:title, -- title
:folder_id, -- parent_id
:user_id, -- creation_user
:creation_ip, -- creation_ip
false -- indb_p
);
select file_storage__new_version (
:filename, -- filename
:description, -- description
:mime_type, -- mime_type
:file_id, -- item_id
:user_id, -- creation_user
:creation_ip -- creation_ip
);
update cr_revisions
set lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]]
where revision_id = :version_id
update cr_revisions
set content_length = lob_length(lob)
where revision_id = :version_id
update cr_revisions
set content = '$tmp_filename',
content_length = $tmp_size
where revision_id = :version_id