 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
Encapsulate sql as SP? |
|
Does SA have this feature? I can't find anything like it in the help file.
That said if it doesn't exist could we put in a feature request for it? There are a few other products of similar caliber to SA that have a simple "convert sql to stored procedure" function/wizard that is very handy.
Thanks!
|
|
Sun Jun 02, 2013 1:16 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Yes. Please see the Refactoring menu -> Extract Procedure. Note that if you want to introduce procedure parameters, do not select declarations of the variables referenced within the code, they will be extracted as parameters
to customize the pattern for extract procedures use Options -> Code Refactoring -> select Refactoring Database Type -> then (procedure create) macro
|
|
Sun Jun 02, 2013 3:50 pm |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
Awesome!
|
|
Sun Jun 02, 2013 4:33 pm |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
Well after toying with it I got it to work.
Even though I wasn't selecting the variable declaration the input parameters weren't being refactored. Turns out that only happens when you set the variable. I mean I get that, it's because otherwise it's considered an unused variable.
I had envisioned something a bit more like:
I'll see where the current implementation takes me though.
One thing I am seeing is that setting the variables sticks within the create procedure code... even though it's recognized as an input variable.
|
|
Sun Jun 02, 2013 4:53 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|