我应用过程“ application Client_OLE2.Obj_Type”。读取word文件并将数据输入到oracle形式的数据块中。
我创建了此表单:
此代码未将数据输入到块中。如果此代码有任何错误,请提出建议
代码:
declare
arg_list client_ole2.list_type;
document client_ole2.obj_type;
documents client_ole2.obj_type;
application client_ole2.obj_type;
wordvalue VARCHAR2(100);
j integer:=1;
BEGIN
IF ( :BLOCK2.FILE IS NOT NULL ) THEN
application := client_OLE2.CREATE_OBJ('WORD.APPLICATION');
Client_OLE2.set_property(application,'Visible','false');
arg_list := client_ole2.create_arglist;
documents := client_ole2.invoke_obj (application, 'documents');
client_ole2.add_arg (arg_list, :BLOCK2.FILE);
document := client_ole2.invoke_obj (documents, 'Open', arg_list);
client_ole2.destroy_arglist (arg_list);
--Go to the first record
go_block('WE_GROUP_HOF_K');
first_record;
loop
If :system.record_status <> 'NEW' then
create_record;
end if;
for k in 1..1 loop
arg_list:= Client_OLE2.create_arglist;
Client_OLE2.add_arg(arg_list, j);
Client_OLE2.add_arg(arg_list, k);
document:= Client_OLE2.get_obj_property(documents, '', arg_list);
Client_OLE2.destroy_arglist(arg_list);
wordvalue := Client_OLE2.get_char_property(document, 'Value');
if k =1 then
:we_group_hof_k.clientid:=wordvalue;
end if;
end loop; --for
j:=j+1;
end loop;
client_ole2.RELEASE_OBJ (documents);
END IF;
exception
when others then
message(SQLERRM);
message(SQLERRM);
end;
答案 0 :(得分:0)
要将BLOB文件加载到Oracle Forms Block,只需执行以下操作:
declare
v_file_path varchar2(2000);
begin
v_file_path :=Get_file_name(select_file=>True);
if v_file_path is not null then
initialize_container('Block.Item',v_file_path );
End if;
end;