The nightmare stored procedure



  • <FONT face=Helv size=2>

    I encountered one of the typical WTF in the code I have to maintain here today. I work on a program that has been developed by about 10 different consultants, on 10 years, with absolutely no standards of documentation.

    I had a message today from the client asking me why a total in a Crystal Reports report wasn't correct.

    The report is pretty simple. It lists a serie of claims and shows the sums and grand totals at the end. So far, nothing really complicated. For those of you who are not familiar with Crystal Reports, it can produce all the summary fields you need easily.

    I'm a little discouraged. The programmer who worked on this report didn't seem to want to search in Crystal Reports functionality. He decided to do everything in the stored procedure. The report is related to a table in the database, which is dropped and rebuilt by a stored procedure. A wonderful 595 lines stored procedure with 2 cursors, multiples calls for 6 differents SQL functions and a code monstrously unformatted. The programmer does all the sums and totals in the stored procedure and the table has fields for the summarys, with the same value for each row... I feel this will be a loooong day. *sigh*

    </FONT>


  • I had to take over a system developed (and "nearly done"!) by a couple of guys in our company a year ago. One of them was an Oracle-man to the core, and didn't trust that "toy language that is Java", and went on to write his own base64-implementation as PL/SQL-procedures. Man, that was slow...

    Our application assumed almost speed-of-light response times (comparatively) when we replaced that with a java-based base64 implementation. We even brought the system up to "usable" status...

    (Disclaimer: I'm a consultant, but a guy has to eat, right?)



  • (Not trying to be a b*stard, but my post really did look better before hitting the "post"-button...)



  • @Fred said:

    ... didn't trust that "toy language that is Java",
    and went on to write his own base64-implementation as
    PL/SQL-procedures.


    Next release of PL/SQL will include GUI widgets.



  • @Eolianne said:

    <font face="Helv" size="2">

    I encountered one of the typical WTF in the code I have to maintain here today. I work on a program that has been developed by about 10 different consultants, on 10 years, with absolutely no standards of documentation.

    I had a message today from the client asking me why a total in a Crystal Reports report wasn't correct.

    The report is pretty simple. It lists a serie of claims and shows the sums and grand totals at the end. So far, nothing really complicated. For those of you who are not familiar with Crystal Reports, it can produce all the summary fields you need easily.

    I'm a little discouraged. The programmer who worked on this report didn't seem to want to search in Crystal Reports functionality. He decided to do everything in the stored procedure. The report is related to a table in the database, which is dropped and rebuilt by a stored procedure. A wonderful 595 lines stored procedure with 2 cursors, multiples calls for 6 differents SQL functions and a code monstrously unformatted. The programmer does all the sums and totals in the stored procedure and the table has fields for the summarys, with the same value for each row... I feel this will be a loooong day. *sigh*

    </font>


    As much as I hate Crystal Reports, it really sounds like it would have been much easier to use Crystal to summarize the data instead of doing it in the stored procedure. There have been a few cases where we needed to use a stored procedure as the source data for a Crystal Report but it is pretty rare where I work.


  • @trollable said:



    Next release of PL/SQL will include GUI widgets.


    Please tell me you are kidding.  Please.  Kidding.  Now.

    /rocks back and forth obsessively in his chair



  • @trollable said:



    Next release of PL/SQL will include GUI widgets.
    Good one!  Hoo! Hoo! Hoo!




  • @trollable said:

    Next release of PL/SQL will include GUI widgets.



    That's actually not as far off as you would like it to be... You do know they have an html-module for PL/SQL, right? GUI widgets is really only the next "logical combination" between that and "Forms"...



    methinks Oracle should just stick to databases...



  • @Fred said:

    @trollable said:
    Next release of PL/SQL will include GUI widgets.

    That's actually not as far off as you would like it to be... You do know they have an html-module for PL/SQL, right? GUI widgets is really only the next "logical combination" between that and "Forms"...

    Think out this. What about about an Oracle sales droid showing this new "feature" to naive and gullible "Pointy Haired Bosses"? It will be selling like hot cakes.

    Nightmares, nightmares...

    Torsten

     



  • @trollable said:



    Next release of PL/SQL will include GUI widgets.


    That's called "Oracle Forms" and almost 10 years old (even older, if you count the text-UI versions before).



  • @Fred said:


    You do know they have an html-module for PL/SQL, right?

    Nothing special about that. Basically some procedures that build long strings (containing the HTML-page) and store it somewhere for the Webserver (or Appserver) to fetch. Hardly a feature you couldn't built into another database (that supports stored procs) on a lazy afternoon.


    GUI widgets is really only the next "logical combination" between that and "Forms"...


    IMO, the next logical step is support for XForms or something similar.
    GUI widgets are something the client has to create; unless you want the database to support X, VNC, ICA, RDP or a similar protocol.
    Oracle Forms is as far as you can get in combining PL/SQL and GUI.



  • @ammoQ said:

    GUI widgets are something the client has to create; unless you want the database to support X, VNC, ICA, RDP or a similar protocol.

    And why not? I paid 80,000 for the dadgummin thing, I should be able to use it as a terminal server too. That way I don't have to pay for custom data apps, just have the users browse the database and update there!



  • @foxyshadis said:

    @ammoQ said:
    GUI widgets are something
    the client has to create; unless you want the database to support X,
    VNC, ICA, RDP or a similar protocol.

    And why not? I paid
    80,000 for the dadgummin thing, I should be able to use it as a
    terminal server too. That way I don't have to pay for custom data apps,
    just have the users browse the database and update there!


    If you read "browse as" in "Firefox", they already made it:











  • @ammoQ said:

    @foxyshadis said:
    @ammoQ said:
    GUI widgets are something
    the client has to create; unless you want the database to support X,
    VNC, ICA, RDP or a similar protocol.

    And why not? I paid
    80,000 for the dadgummin thing, I should be able to use it as a
    terminal server too. That way I don't have to pay for custom data apps,
    just have the users browse the database and update there!


    If you read "browse as" in "Firefox", they already made it:


    So where can I obtain some of this magical ganja that Larry Ellison smokes, anyway? Next thing Peoplesoft will be built right into the database, along with videoconferencing, autocad rendering, and an email/collaboration server.



  • @foxyshadis said:


    So where can I obtain some of this magical
    ganja that Larry Ellison smokes, anyway? Next thing Peoplesoft will be
    built right into the database, along with videoconferencing, autocad
    rendering, and an email/collaboration server.


    email/collaboration:



    http://www.oracle.com/technology/products/ifs/index.html



    (still looking for videoconferencing, autocad rendering and peoplesoft,
    i know it must be somewhere in the Oracle database...) ;-)



  • Sorry, no videoconferencing. Best I can offer is streaming media:

    http://www.oracle.com/technology/products/intermedia/index.html



  • @ammoQ said:

    Sorry, no videoconferencing. Best I can offer is streaming media:

    http://www.oracle.com/technology/products/intermedia/index.html



    Ha, ha!



    I had a part-time job at a company that made a distributed database system a couple of years ago, and overheard one of their core engineers moaning over the oracle specs during lunch. Apparently, they were supposed to implement much the same functionality in their system (for the JDBC-driver), and his comment went along these lines:



    "Streaming?! Well, how the H*** are we supposed to log that?"



    ... wouldn't be fun if it was easy ;-)



  • Man! I have to run the nightmare stored procedure now... it takes about an hour. Just for a measly 3 page report...

    somebody kill me.

     



  • @Eolianne said:

    Man! I have to run the nightmare stored procedure now... it takes about an hour. Just for a measly 3 page report...

    somebody kill me.

     

    I'll start the sp_assassinate over here. Just sit tight and wait. ;)


Log in to reply