Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UTL_FILE formatting

Status
Not open for further replies.

CIMTEET

Programmer
Jun 25, 2001
182
0
0
US
I am working on a unix box and have found the need (desire) to change the font for headers I have been printing. My nedit editor cannot change fonts. Is there a way to do this with UTL_FILE. I have not found anything on the web.

Thanks,
Greg
 
Greg, You printer probably has ASCII control sequences for changing font characteristics. You can concatenate those ASCII values (using Oracle's "CHR(<n>)" function and the "||" concatenate operator) in front of your header strings.

Let us know if that sounds reasonable to you.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Do you mean like this:

UTL_FILE.PUT_LINE('/tmp',CHR(<number i don't know about>)||v_string);

I have been looking on google and have not found a specific text formatting number. Could you point a place to look?

Greg
 
I'll try, Greg. What is the make and model of your printer? Do you know if it has on-board fonts from which to choose?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Dave,

You have done so much for me and I am truly grateful. I do not expect you to look stuff up based on my printer. I am actually printing to an output file. I thought the chr you were referring to would actually change the font size in the string I am printing to my file.

Greg
 
Actually, Greg, that's what I'm saying...some printers allow you to output "control sequences" that trigger changes in font behaviour.

What I do, however, for my reports requiring specialised printing is to identify my choice of document-formatting software, format the style sheet that displays the output as I want it to, then output from Oracle in the manner that the style sheet expects. In this way, I don't need to resort to outputting special ASCII control characters.

Keep us informed of how you resolve your need.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Document-Formatting software? You mean like xml? or Perl? Are you talking about printing from oracle in a specific font? Do you have any examples of what this looks like?

Greg
 
Yes, Greg, XML is an example; I'm not familiar with Perl, but it, too, could format output I'm guessing.

I, personally, use my all-time favourite document formatting package, Ventura Publisher. Corel acquired rights to Ventura from Xerox Corporation (who bought Ventura from the original developers). Corel absolutely ruined the product (e.g., Ventura Version 8) by embedding high-ASCII control characters and other abominations similar to MS Word and other atrocious text processors.

Therefore, I use an ancient version of Ventura (Version 4) that still relies upon "tagging" (i.e., labelling) paragraphs with ASCII-named paragraph types that correspond to formatting rules in a separate tag-styles file that you create.

What I do, then, is format a sample page the way I want it to look (in Ventura), then I code my SQL (or PL/SQL) to output from the database with the simple paragraph tags that correspond to my sample-formatted page.

Using this technique, I've been able to produce 300-page camera-ready books (with headers, footers, formatted tables, footnotes, and indexes, all with their own fonts and specialised appearances) from a single SQL (or PL/SQL) script, without any additional human intervention or tweaking of the output.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Santa,

as a slight aside, a friend of mine has to produce structured documents on a regular basis. He recommended LATEX to me (LAy TEXt) which is capable of full scientific notation and mathematical equation rendering. However, I believe that it can do what you need, and is more up to date and maintained/maintainable.

Unfortunately googling for LATEX will get some extremely dubious sites, but persevere, and you'll find the publishing/printing software.

Regards

T

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top