Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

INOUT Parameter in Mysql stored procedure

 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Where to use INOUT parameter in a stored procedure. What are the benefits ?
What are the trade-offs of using one INOUT vs separately using an IN and OUT parameter ?

Thanks.
 
Brian Tkatch
Bartender
Posts: 567
25
Linux Notepad Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is simply a matter of style, that is, programmers choice. I have used both. In most cases, i with use separate parameters, but if i want to manipulate the parameter within the routine, i will use INOUT.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly I think I have never used an INOUT parameter in production code because I don't see the added value of using such a parameter. You can easily achieve the same using an IN and OUT parameter.
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:if i want to manipulate the parameter withing the routine, i will use INOUT.

So IN and OUT parameters can't be manipulated within the procedure ?
 
Brian Tkatch
Bartender
Posts: 567
25
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shubham Semwal wrote:So IN and OUT parameters can't be manipulated within the procedure ?

IN parameters cannot be manipulated. They are like constants passed as parameters. INOUT can be manipulated. OUT can obviously be manipulated, as it is how the data is returned.
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Brian and Roel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic