Automic Workload Automation

Expand all | Collapse all

How to send SQLI VARA output via email?

  • 1.  How to send SQLI VARA output via email?

    Posted Sep 04, 2014 10:52 AM
    Hi there,

    I'm wondering how I can simply dump the results of an SQLI VARA to email. This feels like it should be easy, but I haven't found that way yet. I've played with PREP_PROCESS_VAR on the SQLI VARA in a CALL object, but this seems way too tedious for simply wanting all of the results from the query sent. I do not want to give end users unlimited access to the DB, so I am looking to build one off solutions that can be locked down and not abused, and also easily shared across many clients as needed. Alternatively, I realize I could build SQL jobs and send the report results, but feels like there should be an easy way to dump an SQLI to email.

    For more context, many users are looking for reporting that does not seem to be offered out of the box easily, but which could be pulled from the DB. A common ask is in the form of "how can we get a daily report emailed to us of what jobs ran last night?" A Periods function would probably fit the bill, but a search didn't reveal that, which brought me to the DB itself.

    We're running AE v9 SP8 with Oracle DB on Linux.

    Thanks for reading; has anyone done this?

    Eric


  • 2.  How to send SQLI VARA output via email?
    Best Answer

    Posted Sep 04, 2014 12:48 PM
    Our solution for "daily report emailed to us of what jobs ran last night" was to use the UC4 Reporting Tool on the UC4 server to define the report, and then we run UCYBDBRT to generate the predefined report.  In our case we call UCYBDBRT twice, once to build the report in html format, and again to build the report in csv format.  The post-process of this job attaches the two reports to an email via the send_mail() script function. 

    We are V9 sp5 with SQLServer on Windows.

    Pete


  • 3.  How to send SQLI VARA output via email?

    Posted Sep 04, 2014 01:34 PM
    There's a limit to the output from a SQL variable as well.

    One thing to think about is the impact of using the SQL variables for reporting. Since it has to come back into the cache for the AE side, it could impact performance if the number of values it's pulling back is very large.


  • 4.  How to send SQLI VARA output via email?

    Posted Sep 04, 2014 02:24 PM
    Thanks for taking the time to respond Pete and Jennifer. We have not looked into the reporting tool, although it has come up in the past. Maybe this is the answer to what we're looking for.  I have started exploring this option.

    Pete, control and set up for your solution remains with the Automic team, correct? The more this can be made accessible for users to build jobs themselves, without introducing danger, the better. I'm beginning to envision standing up a separate system with the UCYBDBRT on it, with an agent deployed that users can use to create their own reports on demand. Possibly we create and make available different reports as needed, giving us a chance to vet, or possible we provide the Reporting Tool for query building as well.

    Thx again, this was a good reminder to circle back on this feature!

    Eric


  • 5.  How to send SQLI VARA output via email?

    Posted Sep 04, 2014 02:37 PM
    Eric:

    Have you reviewed this recent discussion, perhaps it might help?


  • 6.  How to send SQLI VARA output via email?

    Posted Sep 04, 2014 03:02 PM
    Hi Mark,

    I had not seen that thread, thanks for including it here. It certainly adds additional details.

    Eric


  • 7.  How to send SQLI VARA output via email?

    Posted Sep 04, 2014 04:58 PM
    I don't consider the UC4 reporting tool to be useful for on demand requests.  However the "Periods" feature in the client is pretty good for most upon demand requests (as mentioned in the other thread.)  You can distribute the Periods result with rightclick/ExportToFile.


  • 8.  How to send SQLI VARA output via email?

    Posted Sep 05, 2014 10:34 AM
    Hi Pete, 

    I know what you mean. By "on demand," what I really meant was self-service, and able to be scheduled for delivery via email on a daily basis. Periods is a good, quick way of getting info, but I didn't see a function or way to schedule the output be sent via email, which is key. With the reporting tool, we might be able to build a solution that will fit this need.

    Thx all for your input!

    Eric


  • 9.  Re: How to send SQLI VARA output via email?

    Posted Jul 26, 2018 06:09 PM

    I know this thread is old as dirt but I don't believe the original question was ever answered and I'm looking to do this.

     

      So I'll ask,  Is there an easy way to dump the sqli var output to an email or flat file?" 



  • 10.  Re: How to send SQLI VARA output via email?

    Posted Jul 26, 2018 07:56 PM

    You could use prep_process_var() with looping logic to capture and apply your result set to your email one-row-at-a-time.

     

    And I think you could do prep_process_var() to open the result set and then use write_process() to write it to a flat file.  I haven't done this myself though.



  • 11.  Re: How to send SQLI VARA output via email?

    Posted Jul 27, 2018 02:08 PM

    Thanks Pete, You've put me on the right track.