Announcement

Collapse
No announcement yet.

Integrating with StarTeam and SQL Pretty Printer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integrating with StarTeam and SQL Pretty Printer

    I've plugged BC3 into StarTeam, and I now want to add an SQL formatter into the picture, since the PL/SQL currently checked in and the code I'm working with locally are formatted completely differently, making diffs impossible to interpret.

    The SQL formatter I have chosen is SQL Pretty Printer (http://www.dpriver.com), because it's inexpensive, highly customizable, reliably generates the same format from widely divergent original formats of the same content, and has a command-line interface.

    The problem (I think) is, that the commandline syntax for SQL Pretty Printer does not allow me to specify an arbitrary output filename, so BC3 has no idea where to find the output file. My output choices from SQL Pretty Printer include:
    1. Output to stdout
    2. Output to replace the original input file
    3. Output filename (and presumably path) same as the input file, but with a file extension of .spp

    In the context of a revision control system where I am comparing a local file against a repository copy or two repository copies against each other, I don't see option 2 as viable. I have my doubts about option 3 in this scenario, as well.

    Is there any way that I can configure BC3 to capture standard output rather than reading a file? Or do I need to submit a change request to the developer of SQL Pretty Printer, to allow the user to specify an arbitrary output file?

    Or have I completely misconstrued the syntax that BC3 requires?

    Thanks,

    Rebeccah

  • #2
    Can you wrap your call to Pretty Printer in a batch file that takes your arbitrary file name as a parameter and either redirects stdout to that file or copies the .spp file to it?

    Comment


    • #3
      Hello,

      I would also recommend the wrapper solution. If you call a .bat file as the external conversion (passing an input and output) you can pass the input to your command line, then put the stdout output into the output parameter. Something similar to?:
      myconvert.bat "%s" "%t"
      and
      "original command line here" "%1" >> "%2"
      Aaron P Scooter Software

      Comment


      • #4
        Thanks to both of you.

        That's exactly what I did, and it works beautifully.

        Rebeccah

        Comment

        Working...
        X