Hi all.

I'd like to be able to define a stored procedure that returns a recordset ( I've done this bit ), and then select from this in another query, eg:

CREATE [EMAIL PROTECTED] PROCEDURE `sp_MyClients`( IN ACCMAN INT )
BEGIN
select * from mirror_Clients where AccMan = ACCMAN;
END

... and then:

select
C.FileNo, C.SubNo, L.AccountNo
from
( sp_MyClients ( 192 ) ) C inner join TLocations T on C.ClientID = T.ClientID;

I've also tried adding 'call' immediately before the 'sp_MyClients' bit. Either way, I get:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( 192 ) ) C inner join TLocations T on C.ClientID = T.ClientID' at line 1

I assume it's not possible to do this then?

I realise I can skip the stored procedure in this case and just add the where clause from the SP to the query, but in some other cases, the SP bit will be quite complex.


Dan

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to