Re: Storing and retrieving WORD DOCUMENTS from the DB

From: Patrick Flahan <flahan_at_earthlink.net>
Date: Mon, 15 Feb 1999 19:58:09 -0500
Message-ID: <7aaftu$80e$1_at_birch.prod.itd.earthlink.net>


You can use the Text_IO package that is provided with forms to write the template to the operating system. The template can be stored in the database as a CLOB. Since version 5 of Forms doesn't support the use of Oracle8 datatypes (CLOBs in particular) you will need to write a "wrapper" package that uses the DBMS_LOB (dbms_lob.read) package and hides the Oracle8 pieces that Forms 5.0 can't handle. You can loop through the LOB using the dbms_lob.read procedure to read 32k chunks (the maximum size of a varchar2 in pl/sql is 32767) of data and then pass the chunks to Forms to write to the OS.

Hope this helps,
Patrick Flahan
flahan_at_earthlink.net

<chris_brunini_at_hotmail.com> wrote in message news:7a95ov$cnj$1_at_nnrp1.dejanews.com...
>I have a requirement to produce word documents using mail merge. This is a
>list of steps to produce the document - 1) The user creates a template that
>is stored in the database. 2) The user requests a document (internally we
>have set up db tables that allow the user to associate a template with sql
>statements. When the user requests a document these sql statements are
>execute to create a data source document to be used for the template) 3)
the
>Datasource document is created and wriiten to the file system. 4) The
>template needs to be unloaded from the db 5) the template is loaded into
word
>and the datasource file attached 6) the mail merge is performed 7) the
>template is closed 8) If the document is changed this needs to be save back
>to the db, if not discard.
>
>
>Now how do I perform this??
>I am using forms 5 with RDBMS 8.0.4.
>
>I was thinking of using long raws to store the word documents (as there is
no
>way of getting blobs out of the database by just using pl/sql or forms).
Then
>using OLE to get the WORD documents in and out of the DB.
>
>I can get documents into a ole item using forms_ole.initialize_container
and
>then commiting the form.
>
>How do I get it out using pl/sql. I want to be able to write the document
to
>the file system, then open word to read it and perform the mail merge using
>ole commands. I already have worked out how to perform the mail merge
using
>ole, but how do I get the document out to the file system.
>
>Then when the file document has been produced, how do I know that the user
has
>modified it to save it back to the database???
>
>Is there and way to save it to the database with first going through an
forms
>ole item eg using straight pl/sql??
>
>Any help would be appreciated
>
>
>Chris
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Feb 16 1999 - 01:58:09 CET

Original text of this message