[dba-SQLServer] MySQL not MS SQL question

Stuart McLachlan stuart at lexacorp.com.pg
Mon Feb 25 16:58:40 CST 2013


You use CALL, not SELECT ....

Here's a simple example:

In MySQL, I run the following SQL:

CREATE PROCEDURE ShowDistricts()
BEGIN
SELECT * FROM tblDistricts
END;


In Access I create a Passthrough query:

In SQL view I just put: CALL ShowDistricts()
and for the ODBC Connect string, I either create a suitable COnnection string or point to an 
existing DSN for the MySQL database.

I save the query.   I then create a new form and set its RecordSource to the name of that 
query.




On 25 Feb 2013 at 17:41, Arthur Fuller wrote:

> I'm trying to stick with you on this, Stuart, but I don't understand what
> you mean by "put the stored procedure in a pass-thru query. If the SP says
> "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM procName?
> That doesn't make sense. Can you please explain?
> 
> TIA,
> Arthur
> 
> 
> On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan <stuart at lexacorp.com.pg>wrote:
> 
> > You can "Bind" the recordset from a stored procedure by putting that
> > procedure in a
> > pass-trhough query and "binding" to the query
> >
> > Note the quotes around "bind".  Recordset returned by  SPs are snapshots,
> > there is no
> > persistent connection.   So you only view/filter/sort the records.  You
> > can't create/edit/delete
> > any.
> >
> > --
> > Stuart
> >
> >
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 
> 




More information about the dba-SQLServer mailing list