Automic Workload Automation

Expand all | Collapse all

How to save result of sql query in variable?

Jump to Best Answer
  • 1.  How to save result of sql query in variable?

    Posted 08-29-2018 07:21 AM

    Hi all!

    I use action "DB Execute Query"  from JDBC Action Pack for execute SQL-query. After  execution the action I can see result of query in  Report. But I can't find the way to read this result and write it to variable. Can anybody explain me how I can read and write result of query execution?

    Thanks in advance.



  • 2.  Re: How to save result of sql query in variable?
    Best Answer

    Posted 08-29-2018 08:46 AM

    Process the job output using PREP_PROCESS_REPORT, and write rows to the VARA using PUT_VAR.

    #aescripting



  • 3.  Re: How to save result of sql query in variable?

    Posted 08-29-2018 09:33 AM

    Michael thak you for your answer.



  • 4.  Re: How to save result of sql query in variable?

    Posted 08-29-2018 09:12 AM

    Alternatively, you might be able to reshape your solution to put the SQL directly into a SQL variable so you won't have to write the script to process the report. Very likely, your solution will be faster when using a SQL variable, since you won't have the extra step of processing the report. If that is not possible, then Michael's answer is your only choice.



  • 5.  Re: How to save result of sql query in variable?

    Posted 08-29-2018 09:34 AM

    Leonard thak you for your answer