Home » SQL & PL/SQL » SQL & PL/SQL » PLSQL Word Mail Merge (Oracle 8.1.7.4)
PLSQL Word Mail Merge [message #412674] Fri, 10 July 2009 09:36 Go to next message
jramya
Messages: 42
Registered: April 2008
Member
Hi,

I am trying to find the possibility of automating a mail(word)merge using PLSQL.
We have the word template in oracle server with merge fields embedded.
On executing a procedure it should merge the query results in to the template and save as another document.
Can I achieve this using plsql? OR should I use Java?
Any guidance or refference will be greatly appreciated.

Thanks
Ramya J

Re: PLSQL Word Mail Merge [message #412677 is a reply to message #412674] Fri, 10 July 2009 09:52 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
>Oracle V8.1.7.4
Please join the rest of the world in the 21st century & upgrade from obsoleted version.

>Can I achieve this using plsql? OR should I use Java?
Neither. (ab)use .Net since I assume a Windoze environment.

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.
Re: PLSQL Word Mail Merge [message #412679 is a reply to message #412677] Fri, 10 July 2009 10:00 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
No need to get into more Microsoft Stuff than necessary. Very Happy

You basically need Word to do it. So you need OLE automation to do things in Word.

Which can be done on Windows from Java (with the Jacob library) or with PERL (with Win32::OLE)

How exactly is more of a Java/PERL/Word question, though, and there will be other forums more suited to that.
Re: PLSQL Word Mail Merge [message #412680 is a reply to message #412677] Fri, 10 July 2009 10:12 Go to previous messageGo to next message
jramya
Messages: 42
Registered: April 2008
Member
I wish you could have been my boss swan Razz
Re: PLSQL Word Mail Merge [message #412693 is a reply to message #412674] Fri, 10 July 2009 12:11 Go to previous message
coleing
Messages: 213
Registered: February 2008
Senior Member
It can be done in Plsql Very Easy.

Save your word docuemnt as RTF and into a CLOB inthe database.

Put some replaceable text in there for name and address

Like
##NAME##

##ADDRESS##

then just loop through your data, replacing the text from the template, and spit out using UTL_FILE to disk.

Save the file back out as .doc, and word will read it as an RTF but it will still look like a .doc

Previous Topic: Procedure
Next Topic: How to get history of commands?
Goto Forum:
  


Current Time: Fri Dec 02 14:04:30 CST 2016

Total time taken to generate the page: 0.12430 seconds