If there was a good reason to make the change, it must mean the available data is now different, which means the programs using it need to change.
No, that's the point. Likely some programs will change (or new programs written) that triggered the change. But may programs won't. Let's make an example. A bit contrieved perhaps, but it's just an example. Suppose you have a table of addresses, with the usual columns: an id, a key to another table telling you whose address it is, a street address, a city, a state (let's assume US addresses), a zip code, etc. It's an important table because many applications use it. There will be several stored procedures accessing this table, one of them being "get_address":
-- Sybase syntax create proc get_address @addressee int as select street_address, city, state, zip from addresses where @addressee = addressee_id -- addressee_id is the foreig +n key
Now a desire arises to separate the street address into two columns: the name of the street, and the house number. Maybe some application wants to do selects on a street - it doesn't really matter why. The schema can easily be changed, and a conversion program (that reads the table, and splits the street address into a street name and house number) isn't to hard either. Now, if all other programs used the stored procedure to get data out of the table, they don't need to be modified - we just change the stored procedure:
-- Sybase syntax create proc get_address @addressee int as select house_number + " " + street_name, city, state, zip from addresses where @addressee = addressee_id -- addressee_id is the foreig +n key
Note that the signature (the input and output formats) of the stored procedure didn't change. Obviously, applications that want to get the street name separately use different stored procedures.
Trying to hide changes like that behind stored procs and let programs continue as if nothing happened will surely result in slow and complicated joins and the like.
That all depends on how often queries are run, and when. A bank really doesn't care if its end of the week report that's run on the night from Saturday to Sunday now takes 7 hours and 10 minutes instead of the original 7 hours and 3 minutes. But they'll get mighty upset if one batch job every techy forgot about because it was written long before any of them started working there suddenly fails to work. Don't forget that changing the stored procedures doesn't prevent you from writing new (and faster) stored procedures and calling them from your programs. Stored procedures give you the option to leave programs as is if you modify the schemes.

In reply to Re^6: No stored procedure bashing on my watch! by Anonymous Monk
in thread Recoding a multi-sql-statement storedProc transaction in a script by punkish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.