Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

MySQL issue


  • Please log in to reply
2 replies to this topic

#1 hispaladin

hispaladin

  • Members
  • 245 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Middle of a corn field
  • Local time:05:23 PM

Posted 09 February 2016 - 12:58 AM

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.



BC AdBot (Login to Remove)

 


#2 brogoff

brogoff

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:05:23 PM

Posted 19 February 2016 - 07:24 PM

You're right. Wrong forum.

 

Be aware that MySQL isn't the only open source database application. Check out PostgreSQL.



#3 hispaladin

hispaladin
  • Topic Starter

  • Members
  • 245 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Middle of a corn field
  • Local time:05:23 PM

Posted 19 February 2016 - 08:50 PM

While my issue has been worked around, the issue was that I had no choice of what database I used, MySQL was the only option.  

 

Again, the issue has been worked around so no further assistance required  :smash:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users