First off, I am fairly sure this is not the correct forum and for that I am sorry but I wasn't sure so I posted here as I saw at least one other question involving MySQL here. Past that, I am trying to create a stored procedure in MySQL that calls two other stored procedures from within it.
Here is my code for the procedure
begin CALL AddUser(firstname, lastname, role, usern, passw); select last_insert_id() as uid; CALL AddNewCustomer(addr, city, state, zip, email, uid); end
I am working with my schools hosted server (through DeVry). I have declared all the perimeters I just didn't list them as that is a lot of code. The trouble that I am having is that the first CALL statement works and the SELECT works fine but the second CALL does not appear to execute at all. I get no error it just doesn't run the AddNewCustomer procedure. Am I doing something wrong here and if so what? Is it just not possible to have two CALL statements in a single procedure? Over and above that, what I am trying to accomplish here is create a user in two tables, User and Customer. The reason for this is that there will be users that are not customers that will have some of the information that the customer has but not most and the customer needs to have all that info. The uid field is the user id from the user table to link the two together. The User_ID field in the User table is auto-incremented so I do not pass that into the procedure. I need to create a User first then link it to the Customer that is created next. Any help would be greatly appreciated.