WebUtil, как прочитать файл Word в бланк данных оракула - PullRequest
0 голосов
/ 02 апреля 2019

Я применяю процедуру "application Client_OLE2.Obj_Type". Считайте файл слова и введите данные в бланк оракула. ​​Блок данных.

Я создал эту форму:

enter image description here

Этот код не вводил данные в блок. Пожалуйста, предложите мне, если что-то не так в этом коде

Код:

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;
...