[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: New user question: integrating web page, Stata, and MySQL
Paul Bednar (PBednar@unch.unc.edu) writes:
>I'm a new Intercooled Stata 9.2 Windows user trying to integrate a web
>page, Stata, and MySQL.
>Here's the situation. Using a web page, a user selects a date range to
>view actual, budget, and forecast data. The actual and budget data is
>stored in a MySQL database and the forecast data is calculated in Stata
>Is it possible for Stata to receive a request from either MySQL or the
>web page, run the regression and send the output to a MySQL table so the
>forecast data can be provided to the user?
>Perhaps I've misunderstood Stata's Data Management Manual, but odbc
>seems to go from Stata to MySQL, not the other direction.
Stata's ODBC implementation can write data to a data source as well as read
it. You'll be interested in commands -odbc insert-, -odbc exec-, and
You could call Stata in batch mode from whatever scripting language you
are using. You would call separate instances of Stata with do-file
scripts in batch mode, have the do-file fetch the data, process it,
and then write it back to a database table before exiting. This is, of
course, a very high-level description of the solution and there are a
few issues that would need to be addressed before this will work
reliably, namely concurrency, potentially long runtimes, and making
sure you have an appropriate license from StataCorp before using
this for anything other than personal use.
* For searches and help try: