SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Encapsulate sql as SP?

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Encapsulate sql as SP?
Author Message
Mindflux



Joined: 25 May 2013
Posts: 812
Country: United States

Post Encapsulate sql as SP? Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
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 View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 812
Country: United States

Post Reply with quote
Awesome!
Sun Jun 02, 2013 4:33 pm View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 812
Country: United States

Post Reply with quote
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.