Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    144

    Question Unanswered: Why is DB2's stored procedure implementation so different than SQL Server?

    Hello!

    I do not intend to critize but to satisfy my curiosity. Ever since I started to research how to write DB2's stored procedures, I discovered that it was required a C compiler and that a process called binding was involved. I realized then that SQL-PL stored procedured were in fact translated to C (as I found in the temporary files). However, writing SQL Server's stored procedures is just a matter of putting the source code in the appropiate tool and taking them to the server in a "single" step, no need to set up a C environment.

    So, why is DB2's stored procedure implementation seemingly more complex than SQL Server's? Although more complex, is it in fact a better design? Do you think that writing DB's stored procedures would be as straightforward as SQL Server's?

    Thanks a lot for your answers.

  2. #2
    Join Date
    Apr 2003
    Posts
    17

    Re: Why is DB2's stored procedure implementation so different than SQL Server?

    I think the argument is that it's more efficient. The SQL-PL language is a pretty recent invention, to answer complaints from Oracle users and others. IBM's response was always that compiled code is more efficient, and this recent innovation is an attempt to meet people in the middle. They clearly don't like interpreted code.

    Once you do get the compiler setup, though, I think stored procedure builder is a pretty slick tool. One man's opinion.

  3. #3
    Join Date
    May 2003
    Location
    Australia
    Posts
    7
    Does anyone know of a good guide to setup the C compiler for db2 ?

    I have been searching google for the last 2 days and found a few tutorials and guides but the compiler still complains about nmake.

    I have visual c++ 6.0 and have set the DB2_SQLROUTINE_COMPILER_PATH and DB2_SQLROUTINE_COMPILER_COMMAND in the command window utility.

    Is there anything else im missing.

    At the moment im using the Java compiler for the time being but would like to know how to setup the C compiler properly.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Don't know if it will help, but check the DB2 Application Building Guide. There is information on Microsoft Visual C++ in the manual.

    Manuals are available on the IBM website at:
    http://www-3.ibm.com/cgi-bin/db2www/...bs.d2w/en_main

  5. #5
    Join Date
    May 2003
    Location
    Australia
    Posts
    7
    Thats the one that i was following

  6. #6
    Join Date
    Apr 2003
    Posts
    191

    Re: Why is DB2's stored procedure implementation so different than SQL Server?

    Hi,

    more efficient? For cursor programming perhaps. But triggers, stored procedures and user defined functions could need some decent SQL-PL that executes code right in the engine with no context switches or the like.

    I would like to have it both ways. Happily, IBM is about to do more in this direction, I believe.

    Just my 2 cents
    Johann

    Originally posted by browen
    I think the argument is that it's more efficient. The SQL-PL language is a pretty recent invention, to answer complaints from Oracle users and others. IBM's response was always that compiled code is more efficient, and this recent innovation is an attempt to meet people in the middle. They clearly don't like interpreted code.

    Once you do get the compiler setup, though, I think stored procedure builder is a pretty slick tool. One man's opinion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •