Morning :)

1. You sure can, e.g:

CREATE PROCEDURE `user_authenticate`(IN sUserName VARCHAR(25), IN sPassword
CHAR(32), OUT sUserCookie CHAR(32))

BEGIN

DECLARE iUserID INT;
DECLARE iLogID INT;

SELECT MD5(CONCAT(UserID,NOW())) INTO sUserCookie FROM users WHERE UserName
= sUserName AND Password = sPassword;

IF LENGTH(sUserCookie) = 32 THEN 
UPDATE users SET Cookie = sUserCookie, LoggedOnAt = NOW() WHERE UserName =
sUserName AND Password = sPassword; 
SELECT UserID INTO iUserID FROM users WHERE Cookie = sUserCookie;
CALL processlog_write(NULL, 'user_authenticate', CONCAT('User authenticated
successfully (', sUserName, ').'), iUserID, iLogID);

ELSE CALL processlog_write(NULL, 'user_authenticate', CONCAT('User
authentication failed (', sUserName, ')'), 0, iLogID);

END IF;

END

2. I believe this is planned for the future - I read something about it in
the documentation not long ago.

Sounds like an oddness either with 5.0.1-alpha, or with your build - I am
using the pre-compiled binary version of 5.0.0a-alpha on Win2k, and the
above procedure executes with no problems at all.

As a side note, does anyone know if it is now confirmed that views will be
in 5.1 rather than 5.0? :) I know, I know.. I keep harping on about views...


Regards,


Matt.


-----Original Message-----
From: Michael Pheasant [mailto:[EMAIL PROTECTED] 
Sent: 03 April 2004 11:57
To: [EMAIL PROTECTED]
Subject: can't call a stored proc from another stored proc?

Hi,

1) Can a stored procedure call another stored procedure?
  Ie, can you do 'call someproc()' from within a stored procedure?

2) Also, will a function ever be able to issue a SELECT query?

I am using mysql-5.0.1-alpha (built froms ource) , winXP & win2k. 
The mysql daemon crashes without an error message when I try (1)

Cheers,

Mike 



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




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

Reply via email to