3 Replies Latest reply on Apr 29, 2009 6:30 AM by marklitherland

    InDesign and SQL procedures


      I hope I'm posting this in the right place.  I'm a dba at my company, and I need to get database information to the production artists working in InDesign.  Most of the plugins I've found provide some sort of either direct link to database tables, or a scripting language in which InDesign user can create their own queries.  Neither of those models works for us.  Our data is very large, spread out and complex, and what I need to get to the artists is the result of a complex join.  They shouldn't have to deal with that sort of logic.  So what I really want is one of my db guys to write a stored procedure that handles all the logic and assembles the data.  The InDesign user just clicks a button, enters a couple parameters (product code and client) which are passed to the procedure, and then the procedure returns the needed data to be populated into the design file.  As long as the InDesign file contains the proper fields/tags it should be straightforward.  It sure seems like this should be easy, but can it be done this way?

        • 1. Re: InDesign and SQL procedures
          Kasyan Servetsky Level 5

          As far as I know you can’t operate on a database directly from InDesign. But you can get an XML file from SQL database and import it into InDesign document and process it with a script. I did a thing like that once: it was a script for a classified section of a daily newspaper. They gather information via web interface into SQL database then export it into an XML file, then the script imports the XML-file into the classified section of the newspaper and applies the necessary formatting to the text and places images. It was a ‘run the script and everything is almost done’ solution.

          If you are interested you can download this script from here:




          • 2. Re: InDesign and SQL procedures
            SuperMacGuy Level 2

            I have something like that running at my job. We use Macs so we need the Actual Technologies system plug in to access the MS-SQL server directly. But our DB guys have made a procedure that gets data based on one value that is passed to it. The user runs a script, well actually they enter a number in a field in my app and then press a button, and data is returned. It's not going right into InDesign but once you have the data, you can work with it from there.

            I'm running an Applescript, but I bet similar things could be done with JS or VB, or maybe the previous poster's solution will work for you too.

            • 3. Re: InDesign and SQL procedures
              marklitherland Level 1

              Thank you both very much, I really appreciate the information.  Between the two it sounds like there is a solution out there.  We're going to trial a couple plugins this afternoon to see if we can get the data, and once we have it can work with it via script.  I'm going to download the script you provided and it should give us a big jump start.  Thanks!