Select to view content in your preferred language

Returning a text box / message string containing SQL query results in Python

3391
1
10-10-2014 09:55 AM
AndrewVitale1
Emerging Contributor

Hello all,

I’ve bumped into a bit of a specific question, and I’m reaching out for help. 

Several years back, I started using Model Builder scripts in Python and running them as Scheduled Tasks (No problem).  Since some functions and calculations can be run more efficiently by SQL rather than ESRI tools within a Model, I’ve also begun to add some SQL queries and code into my Python script that are based on the Model builder results (all within the same python script).  An example of this is here.

Here is my issue:

I now need to return a message box or text string to the user from the Python script containing results of the SQL code used within the same Python script.  I can get a message box, but I need the message box to contain certain query results.  Has anyone else tried this?  Do you have any resources that might be able to help? 

Contact me if you need further details. 

Tags (2)
0 Kudos
1 Reply
JoshuaBixby
MVP Esteemed Contributor

A fairly broad question.  What specifically have you tried already?  Do you have specific code that is generating errors?  If so, what are the parts of the code generating errors and what are the errors?

Not to answer a question with a question, but it is easier to get specific and quicker feedback when more details are given, especially samples of code that aren't working for you.

0 Kudos