Jump to content
Larry Ullman's Book Forums

What Data Types Can Be Used For Parameters In Stored Procedures?


Recommended Posts

I'm wondering what data types can be used for parameters in stored procedures.

I ask because the examples in the book and the examples I've seen online always declare parameters of the type INT or VARCHAR.

Is it possible to have parameters of the type TEXT?

 

I have a large string of data that I want to place in the DB with a stored procedure, but when I try to make the parameter of type TEXT, the call to the stored procedure fails. However, if I change the type of the parameter to VARCHAR with some ridiculously large character limit (e.g., VARCHAR(5000)), then the stored procedure works.

 

Why is that?

Is there something I'm unaware of with stored procedures in MySQL?

 

Please note that I'm using the latest version of XAMPP.

Thanks.

Link to comment
Share on other sites

Nevermind, please ignore this topic.

For some inexplicable reason, when I changed VARCHAR back to TEXT and re-created the procedure, it worked fine.

I have absolutely no clue why it works now.

 

Sorry for the trouble, all.

Link to comment
Share on other sites

Yeah, it's the most bizarre thing, as I gave up on the script when it wasn't working and went to bed, and then the next day, the only thing I did was delete the stored procedure and remake the same exact one.

Obviously, that made the difference, but no clue why.

 

Oh well. All's well that ends well.

Link to comment
Share on other sites

 Share

×
×
  • Create New...