[dba-SQLServer] MySQL not MS SQL question

Arthur Fuller fuller.artful at gmail.com
Mon Feb 25 18:05:00 CST 2013


Ah! Thanks so much! I hope to be off to the races now. I had no idea you
could use CALL in a pass-through query.

This begs a question. Assuming the SP accepts parameters, how to pass them
in the CALL statement? just type them in after the SP name?

Thanks,
A.


On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan <stuart at lexacorp.com.pg>wrote:

> 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
> >
> >
>
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>


-- 
Arthur
Cell: 647.710.1314

Prediction is difficult, especially of the future.
  -- Niels Bohr


More information about the dba-SQLServer mailing list