Open word which is stored in database. And Re-store the modified file in the database [message #445101] |
Thu, 25 February 2010 22:22 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
havok
Messages: 36 Registered: February 2010
|
Member |
|
|
Hi!
I create a trigger that reads the BLOB field to the document msWord. After completion, restore to the table to BLOB field modified document.
declare
my_cmd Varchar2(128) ; -- comand in cmd to open file
my_path Varchar2(128); -- path to tmp file
my_nom Varchar2(100) ; -- name of tmp fayla
my_fic Varchar2(128); -- fullname of tmp fayla
ln_But Pls_Integer ; -- somthing
proc_id WEBUTIL_HOST.PROCESS_ID;
blob_nomer number; -- nomer stroki (blob-polya)
flag boolean;
begin
blob_nomer:=1;
if(:LEMDOK_468.NITEM is not null) then
blob_nomer:=:LEMDOK_468.NITEM;
end if;
my_path := 'D:\';
my_nom:='tmp' || blob_nomer || '.doc';
my_fic := my_path || my_nom ;
--display_mess(my_fic);
flag:=WEBUTIL_FILE.DELETE_FILE( my_fic );
IF not webutil_file_transfer.db_to_client(
my_fic, -- the name where the file should be stored locally
'FIRST_TEST_IVAN', -- the table-name of the table where your blob is stored in
'FILE_WORD',-- the column-name of the BLOB-column
'nomer = ' || blob_nomer -- the WHERE-clause needed to select the appropiate record from the table
) THEN
display_mess('NOT load');
Raise Form_trigger_Failure ;
END IF;
my_cmd := 'cmd /c start "" /WAIT "' || my_fic || '"' ;
proc_id := WEBUTIL_HOST.Blocking( my_cmd ) ;
-- open temp file and block form. After exit from msWord perform next commands
-- Re-store the modified file in the database --
IF not webutil_file_transfer.client_to_DB(
my_fic, -- the name where the file should be stored locally
'FIRST_TEST_IVAN', -- the table-name of the table where your blob is stored in
'FILE_WORD',-- the column-name of the BLOB-column
'nomer = ' || blob_nomer -- the WHERE-clause needed to select the appropiate record from the table
) THEN
display_mess('NOT saved');
Raise Form_trigger_Failure ;
else
display_mess('has saved');
If WEBUTIL_FILE.DELETE_FILE( my_fic ) = FALSE Then
display_mess('NOT deleted');
Bell ;
ELSE
display_mess('has deleted');
End if ;
End if;
Clear_Message ;
end;
But how to make the form is not blocked? And to make users can open a lot of files from different blob fields? If I use WEBUTIL_HOST.NonBlocking, then the form opens word and immediately executes the following commands (saves only the open document). Help Please!
[Updated on: Thu, 25 February 2010 22:28] Report message to a moderator
|
|
|
|
|