Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > DB2 > how to compile and call

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-02, 11:34
nbandire nbandire is offline
Registered User
 
Join Date: Jan 2002
Posts: 8
how to compile and call

All,

I am a newbie to DB2. We have UDB 7.1 version on sun solaris 2.7.
I have a SQL stored procedure in script. Could someone let me know how to compile and call the stored procedure from command line
and how to trap errors.

Thanks a bunch in advance.

Nilima
Reply With Quote
  #2 (permalink)  
Old 01-09-02, 11:10
dcronin dcronin is offline
Registered User
 
Join Date: Nov 2001
Posts: 3
Not sure what you are refering to compiling in DB2, but, the following will save your store procedure in DB2, if it's create statement is in the example name. (script.db2). Note be sure your script.db2 contains a 'connect to' statement at the beginning and a 'terminate' statement at the end. conclude each statement with a semicolon.


db2 -tvf script.db2


If you are refering to .SQC code using db2's PREP command you will need a C++ compiler and linkage editor.
Reply With Quote
  #3 (permalink)  
Old 01-14-02, 06:32
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 3,641
Re: how to compile and call

For creating SQL Stored Procedure you require a C/C++ compiler installed on the server.

Cheers

Sathyaram

Quote:
Originally posted by nbandire
All,

I am a newbie to DB2. We have UDB 7.1 version on sun solaris 2.7.
I have a SQL stored procedure in script. Could someone let me know how to compile and call the stored procedure from command line
and how to trap errors.

Thanks a bunch in advance.

Nilima
Reply With Quote
  #4 (permalink)  
Old 12-13-02, 13:09
fillet70 fillet70 is offline
Registered User
 
Join Date: Dec 2002
Posts: 2
Re: how to compile and call

Quote:
Originally posted by sathyaram_s
For creating SQL Stored Procedure you require a C/C++ compiler installed on the server.

Cheers

Sathyaram
Reply With Quote
  #5 (permalink)  
Old 12-13-02, 13:10
fillet70 fillet70 is offline
Registered User
 
Join Date: Dec 2002
Posts: 2
Re: how to compile and call

Quote:
Originally posted by sathyaram_s
For creating SQL Stored Procedure you require a C/C++ compiler installed on the server.

Cheers

Sathyaram




Do we need a C compiler on AIX to run a SQL stored procedure ?
My SQL stored procedure for db2 works on the AIX development server but
does not on the AIX production server.
I get an error SQLCODE = -1103 and msgtoken=db2udp.
I plan to ask the unix administrator to check for this file db2udp on the
production server. Somebody mentioned to me that i need to have a C
compiler on the production server. Why is this ?
I thought an SQL stored procedure was compiled by a db2 program db2udp.
Where does the C Compiler come into the picture ? ( this would only make
sense if the stored procedure was converted to a c pgm which was then
compiled by the c compiler. But this seems to be a bad approach by IBM)
Reply With Quote
  #6 (permalink)  
Old 12-16-02, 09:43
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 3,641
Re: how to compile and call

As you mentioned, your stored procedure is converted to a C embedded SQL program and compiled ....

I do not think you require a C compiler to execute your stored procedure, but, you will require C compiler to create the procedure ...
From Version 7.2, it is sufficient to have the compiler on only one machine(for each OS). GET ROUTINE and PUT ROUTINE can be used to take procedures from dev to test to prod ...

Cheers

Sathyaram

Quote:
Originally posted by fillet70
Do we need a C compiler on AIX to run a SQL stored procedure ?
My SQL stored procedure for db2 works on the AIX development server but
does not on the AIX production server.
I get an error SQLCODE = -1103 and msgtoken=db2udp.
I plan to ask the unix administrator to check for this file db2udp on the
production server. Somebody mentioned to me that i need to have a C
compiler on the production server. Why is this ?
I thought an SQL stored procedure was compiled by a db2 program db2udp.
Where does the C Compiler come into the picture ? ( this would only make
sense if the stored procedure was converted to a c pgm which was then
compiled by the c compiler. But this seems to be a bad approach by IBM)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On