vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, has anyone been able to compile SQL stored procedures on DB2 v7 UDB using the freeware GNU C complier on Windows using MinGW (http://www.mingw.org/). Must one use Visual C (5, 6, or .NET) from Microsoft for compiling stored procedures, or are there alternatives on Windows, preferably freeware? Regards Rudolf Bargholz |
| |||
| Always embarassing when it is so obvious - just Google :-) Thanks Rudolf "Gert van der Kooij" <gk-ibm-db2@xs4all.nl> schrieb im Newsbeitrag news:MPG.199ef12cdf05e48f9898a5@news.xs4all.nl... > In article <3f34b953@news.swissonline.ch>, bargholz@spamcop.net > says... > > Hi, > > > > has anyone been able to compile SQL stored procedures on DB2 v7 UDB using > > the freeware GNU C complier on Windows using MinGW (http://www.mingw.org/). > > Must one use Visual C (5, 6, or .NET) from Microsoft for compiling stored > > procedures, or are there alternatives on Windows, preferably freeware? > > > > Regards > > > > Rudolf Bargholz > > > > > > > > Using Google to search using the keywords 'db2 gcc windows': > > http://www7b.software.ibm.com/dmdd/l...306haungs/0306 > haungs.html |
| |||
| Rudolf Bargholz wrote: > Hi, > > has anyone been able to compile SQL stored procedures on DB2 v7 UDB using > the freeware GNU C complier on Windows using MinGW > (http://www.mingw.org/).# Hy Rudolf, your question sounds strange to me! The compilation of a stored procedure (anyway for DB2 or ORACLE) is the job of the RDBMS and not of any calling or using programming language ! > Must one use Visual C (5, 6, or .NET) from > Microsoft for compiling stored procedures, or are there alternatives on > Windows, preferably freeware? Yo do not have to use Visual-Madness or .NOT compilers to compile your PL/SQL code! > Regards > > Rudolf Bargholz Sincerily Groovy |
| |||
| Hi Serge, an SQL DB2 stored procedure is compiled by DB2 using the C complier to a dll and is placed in the C:\Programme\SQLLIB\function\routine\sqlproc\DATAB ASE\SCHEMA\ directory. Without a compiler (at present I am using Visual C++ v6) I am not able to create stored procedures written in SQL. Am I missing something? As far as I know DB2 does not come with a built in compiler for creating stored procedures, but I am still a beginner, so please correct me if I am wrong. Basis for my statement is the "DB2 SQL Procedural Language for Linux, UNIX and Windows" Appendix B where it states the following ---begin quote--- To support remote database development, the following components must be installed on the database server machine: ° DB2 Personal, Workgroup or Enterprise Server Edition ° DB2 Application Development Client In addition, you will also need to install a supported C compiler on the server to compile the stored procedures. ---end quote--- Regards Rudolf Bargholz "Serge Rielau" <srielau@ca.eyebeem.com> schrieb im Newsbeitrag news:bh36km$7kb$1@hanover.torolab.ibm.com... > Christian, > > You don't have to, but AFAIK, Oracle 9i now supports compilation of PL/SQL > into executables using a C-compiler. > > Cheers > Serge > > |
| |||
| You are correct. At present, a "C" compiler is required to compile SQL stored procs. I believe IBM is working to eliminate this requirement. But for now, for each combination of an os level/db2 level, a "C" compiler is required. What that means is that you can compile once on a source machine and distribute the executable to other machines using the GETROUTINE/PUTROUTINE commands, but those machines must all be at the same os and db2 levels. Why wouldn't you be able to use Visual C++ V6? Larry Edelstein Rudolf Bargholz wrote: > Hi Serge, > > an SQL DB2 stored procedure is compiled by DB2 using the C complier to a dll > and is placed in the > > C:\Programme\SQLLIB\function\routine\sqlproc\DATAB ASE\SCHEMA\ > > directory. Without a compiler (at present I am using Visual C++ v6) I am not > able to create stored procedures written in SQL. Am I missing something? As > far as I know DB2 does not come with a built in compiler for creating stored > procedures, but I am still a beginner, so please correct me if I am wrong. > Basis for my statement is the "DB2 SQL Procedural Language for Linux, UNIX > and Windows" Appendix B where it states the following > > ---begin quote--- > To support remote database development, the following components must be > installed on the database server machine: > > ° DB2 Personal, Workgroup or Enterprise Server Edition > ° DB2 Application Development Client > > In addition, you will also need to install a supported C compiler on the > server to compile the stored procedures. > ---end quote--- > > Regards > > Rudolf Bargholz > > "Serge Rielau" <srielau@ca.eyebeem.com> schrieb im Newsbeitrag > news:bh36km$7kb$1@hanover.torolab.ibm.com... > > Christian, > > > > You don't have to, but AFAIK, Oracle 9i now supports compilation of PL/SQL > > into executables using a C-compiler. > > > > Cheers > > Serge > > > > |
| |||
| On Sun, 10 Aug 2003 08:12:11 +0200, Rudolf Bargholz wrote: > Hi Serge, > > an SQL DB2 stored procedure is compiled by DB2 using the C complier to a dll > and is placed in the > > C:\Programme\SQLLIB\function\routine\sqlproc\DATAB ASE\SCHEMA\ > > directory. Without a compiler (at present I am using Visual C++ v6) I am not > able to create stored procedures written in SQL. Am I missing something? As > far as I know DB2 does not come with a built in compiler for creating stored > procedures, but I am still a beginner, so please correct me if I am wrong. > Basis for my statement is the "DB2 SQL Procedural Language for Linux, UNIX > and Windows" Appendix B where it states the following > > ---begin quote--- > To support remote database development, the following components must be > installed on the database server machine: > > ° DB2 Personal, Workgroup or Enterprise Server Edition > ° DB2 Application Development Client > > In addition, you will also need to install a supported C compiler on the > server to compile the stored procedures. > ---end quote--- > > Regards > > Rudolf Bargholz > > "Serge Rielau" <srielau@ca.eyebeem.com> schrieb im Newsbeitrag > news:bh36km$7kb$1@hanover.torolab.ibm.com... >> Christian, >> >> You don't have to, but AFAIK, Oracle 9i now supports compilation of PL/SQL >> into executables using a C-compiler. >> >> Cheers >> Serge >> >> Rudolf, You are correct (although I have heard that there are plans, but no promises, to take away this restriction). For what it is worth, I've had some success using GCC on AIX instead of the IBM C compiler to build stored procedures. I've taken a note of the URL for Windows GCC and will be trying that sometime as well. Note that you don't actually need to build the SP on the production server (since you may not wish to have a compiler on your production box for security reasons). There are recently introduced facilities to package up the SP on a test box and install it on the production box. From memory these commands are "GET ROUTINE" and "PUT ROUTINE". You'll still need the compiler on your development box however. HTH Phil |
| |||
| use db2set for DB2_SQLROUTINE_COMPILE_COMMAND=F:\binFIRST\db2gcc. CMD SQLROUTINE_FILENAME File: F:\binFIRST\db2gcc.CMD (2 lines of text) gcc -v -c -g -mno-cygwin -I%DB2PATH%\include %1.c -o %1.o dllwrap -mno-cygwin -target i386-mingw32 -o %1.dll %1.o %DB2PATH%\lib\db2api.lib --def F:\binFIRST\DB2GCCD.def File: F:\binFIRST\DB2GCCD.def EXPORTS pgsjmp@8 pgsjmp=pgsjmp@8 I'm not sure the pgsjmp=pgsjmp@8 line is ok. PM |
| |||
| Hi Larry, at present our customers are still using 7.1 . I would prefer to install a complier at the sites in case there is a problem with copying the dlls. We would have to install the latest fix packs, so installing the compiler would not be too much more work. I would look really stupid if we bring out a new version and the stored procedures the app would rely on would not work. I just want to make sure there would be a viable alternative if the GETROUTINE/PUTROUTINE does not function for some reason or other. The reason I had a look at MinGW was the really simple installer. Regarding your question about using VC6: It works, so I could use it, but the compiler would seldom be needed. I would like to avoid the unnecessary cost of MS licencing. Regards Rudolf Bargholz "Larry" <lsedels@us.ibm.com> schrieb im Newsbeitrag news:3F366CAB.75672704@us.ibm.com... > You are correct. At present, a "C" compiler is required to compile SQL stored > procs. I believe IBM is working to eliminate this requirement. But for now, for > each combination of an os level/db2 level, a "C" compiler is required. What that > means is that you can compile once on a source machine and distribute the > executable to other machines using the GETROUTINE/PUTROUTINE commands, but those > machines must all be at the same os and db2 levels. > > Why wouldn't you be able to use Visual C++ V6? > > Larry Edelstein > > Rudolf Bargholz wrote: > > > Hi Serge, > > > > an SQL DB2 stored procedure is compiled by DB2 using the C complier to a dll > > and is placed in the > > > > C:\Programme\SQLLIB\function\routine\sqlproc\DATAB ASE\SCHEMA\ > > > > directory. Without a compiler (at present I am using Visual C++ v6) I am not > > able to create stored procedures written in SQL. Am I missing something? As > > far as I know DB2 does not come with a built in compiler for creating stored > > procedures, but I am still a beginner, so please correct me if I am wrong. > > Basis for my statement is the "DB2 SQL Procedural Language for Linux, UNIX > > and Windows" Appendix B where it states the following > > > > ---begin quote--- > > To support remote database development, the following components must be > > installed on the database server machine: > > > > ° DB2 Personal, Workgroup or Enterprise Server Edition > > ° DB2 Application Development Client > > > > In addition, you will also need to install a supported C compiler on the > > server to compile the stored procedures. > > ---end quote--- > > > > Regards > > > > Rudolf Bargholz > > > > "Serge Rielau" <srielau@ca.eyebeem.com> schrieb im Newsbeitrag > > news:bh36km$7kb$1@hanover.torolab.ibm.com... > > > Christian, > > > > > > You don't have to, but AFAIK, Oracle 9i now supports compilation of PL/SQL > > > into executables using a C-compiler. > > > > > > Cheers > > > Serge > > > > > > > |
| ||||
| "Rudolf Bargholz" <bargholz@spamcop.net> wrote in message news:<3f34b953@news.swissonline.ch>... > Hi, > > has anyone been able to compile SQL stored procedures on DB2 v7 UDB using > the freeware GNU C complier on Windows using MinGW (http://www.mingw.org/). > Must one use Visual C (5, 6, or .NET) from Microsoft for compiling stored > procedures, or are there alternatives on Windows, preferably freeware? > > Regards > > Rudolf Bargholz HI .. I did able to compile the stored procedures using GNU c compoler . We have to modify few settings ( which were wrong in documentation ) !!! Thanks Uma |