[thelist] Weighted Grouped Select -- A stored procedure?

J. Blanchard jay.blanchard at thermon.com
Wed Apr 25 08:05:43 CDT 2001


----
Can you explain a little further to what you are referring?  It sounds very interesting.
----

OK, here is an example

Create Procedure ChangeValue
     @BaseValue Int
   As
     If ( @BaseValue =>This Value ) Return (New Value)

followed by the SELECT statement(s) (yes there can be multiple SELECTS in an SP)

The stored procedure is called like this;

Execute ChangeValue

In the SP you can declare variables, perform conditional (IF ELSE) operations, WHILE loops, etc. As you can see this is quite a powerful tool. An entire book can be written on SP's and Cursors, which is another way perform complex calculations on DB objects that aren't easily done with SELECT statements. There are some good books out there depending on which RDBMS you are using.

It works with most DB's except for MySQL which currently does not support stored procedures or triggers. MS Access also lacks these features, at least the last version I used a couple of years ago.

I know that this wasn't crystal clear, I only shoved you in a particular direction. I recommend referring to (oh my god) the documentation that comes with your RDBMS (because there ARE differences) and seeking out third party books on the subject of said RDBMS. There are many good SQL books out there, but many do not cover SP's as these are not standard equipment on all DB's.

Jay Blanchard
Web Engineer & Very Hip Guy
Thermon Industries
1.800.820.HEAT x327

"Hipness is what it is" -- Tower of Power, What Is Hip?

<tip type="education">
We web wranglers wear many hats so the value of eductaion through seminars, night classes, conferences, etc cannot be underestimated. More and more is being demanded of developers, no matter their field of expertise. As the commercials say, "The more you know..."
</tip>

___________________________________________________________________________
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.





More information about the thelist mailing list