DB2/6000 USAGE QUESTIONS.

ITEM: RTA000053801



QUESTION:                                                                       
                                                                                
 1) - WHEN DECLARING TABLES IN C, PUTTING THE DEFINES BEFORE THE FIRST          
      FUNCTION MAKES THEM GLOBAL. IS THERE A WAY TO DECLARE THEM LOCALLY        
      TO EACH FUNCTION TO CONSERVE MEMORY?                                      
                                                                                
 2) -  WHEN A PROCESS FORKS A CHILD PROCESS AND THAT PARENT HAS A DB            
       CONNECTION , DOES THE CHILD ALSO HAVE A CONNECTION?                      
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: This is discussed on page 140 of the Programming Referece Manual,            
Publication Number SC09-1573-00.   You are referencing the host variable        
declarations which correspond to the table items.   The precompiler             
considers host variables as global to a module.   Therefore, host               
variable names must be unique within a module, even if they are local to       
a function.   After the application is precompiled, host variables are          
used by the compiler as any other C variable and the same rules apply.          
                                                                                
Database access is on a "process level".   Therefore, the child will not        
inherit the DB connection even if the parent has such a DB connection.          
                                                                                
Thank you.                                                                      
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                                
                                                                                
This item was created from library item Q677537      FFRCV                      
                                                                                
Additional search words:                                                        
DB2 DEC94 FFRCV IX OZIBM OZNEW QUESTION RISCDB2 RISCSYSTEM SOFTWARE            
USAGE 6000                                                                      
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000053801 ITEM: RTA000053801
Dated: 10/1996 Category: RISCDB2
This HTML file was generated 99/06/24~12:43:21
Comments or suggestions? Contact us