Home » SQL & PL/SQL » SQL & PL/SQL » printf-line add-on
printf-line add-on [message #200844] Wed, 01 November 2006 10:08 Go to next message
TylerD
Messages: 2
Registered: November 2006
Location: Gainesville, FL
Junior Member
Does anyone know if there is an add-on util, extension, or anything for Oracle SQL and/or PL/SQL which provides an output format more like the c "printf" statement as opposed to the distinctly lame combo of DBMS_OUTPUT and TO_xxx functions?

Just curious. From what I've read so far, it appears as though it should be moderately doable in PL/SQL, which makes me presume that someone likely has long since done it, since Oracle has been around a while.

Also, anyone able to recommend a flexible code formatting tool for converting random pl/sql code to a definable "office-specific" format? Our programmers like to do their code in their own style but we'd like to reformat it to match office standards when it becomes "released". If it's possible to avoid reformatting by hand (incl. existing code) and/or forcing the programmers to use a style they don't like, it would BARGT.

And suggestions or assistance would be greatly appreciated.

TIA.
Re: printf-line add-on [message #200858 is a reply to message #200844] Wed, 01 November 2006 12:34 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
On PRINTF, no, I don't know of anything.

On the second point, the only thing I know that does is is TOAD. If you have the later versions (8+), it has an option to reformat code according to a specified standard.
Re: printf-line add-on [message #200859 is a reply to message #200844] Wed, 01 November 2006 12:36 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Would this be of any help?
http://www.orafaq.com/utilities/sqlformatter.htm
Re: printf-line add-on [message #200896 is a reply to message #200859] Wed, 01 November 2006 16:18 Go to previous message
TylerD
Messages: 2
Registered: November 2006
Location: Gainesville, FL
Junior Member
Unfortunately the problem with the Formatter is that it's pretty locked into a fixed idea of the format (thank you anyway, it is interesting...).

This is more a matter of having an office standard but not wanting to ram it down everyone's throats. If you have a reformatter then people can ignore the rules and code as they prefer (which, by my lights, makes it more pleasant and more productive), but at the end of the project (or at "delivery") you can readily make things match the "office standard".

It may be possible to alter the underlying code of that formatter that's being run, I suppose, but if you're going to go that far you might as well write your own... It would be better to start with something rule based which had a set of Oracle PL/SQL rules to start with, which could then be altered to match the local standards as desired, and even as time permitted and new rules were recognized as needed.
Previous Topic: how to query using sysdate 13 hours ago
Next Topic: Which one is pre compiled?
Goto Forum:
  


Current Time: Fri Dec 09 09:53:13 CST 2016

Total time taken to generate the page: 0.07111 seconds