日期:2014-05-16  浏览次数:20769 次

关于.pc文件编译后会多产生些代码吗?请帮我看看这段代码
.pc的内容:
#include   <ctype.h>
#include   <string.h>
#include   <strings.h>
#include   <sys/types.h>
#include   <time.h>
#include   <stdarg.h>

#define   CHAR_SP   '\n '

EXEC   SQL   INCLUDE   sqlca;
EXEC   SQL   INCLUDE   sqlda;

/*   Second   connect   to   database   */
int   connectDb(char   *sUser,   char   *sPwd,   char   *sTns,   char   *sPlat)
{    
int   nRet;

EXEC   SQL   BEGIN   DECLARE   SECTION;
VARCHAR           UserName[30];    
VARCHAR           PassWord[30];
VARCHAR           HostName[30];        
VARCHAR           PlatCode[30];
EXEC   SQL   END   DECLARE   SECTION;

        strcpy((char   *)   PlatCode.arr,   sPlat);
        PlatCode.len   =   strlen((char   *)   PlatCode.arr);
       
if(   connDB(sUser,   sPwd,   sTns)   !=   0   )
        {
printf(   "ERROR:   First   Connect   to   DB.\n "   );
exit(-1);
        }
        printf(   "\nFirst   Connected   to   ORACLE   success.\n "   );

if(   PlatCode.len   ==   0   ) /*   Do   not   need   second   connect   to   DB   */
return   0;

EXEC   SQL   SELECT   LOGIN_SERVERNAME,LOGIN_USERNAME,LOGIN_PASSWORD
into     :HostName,   :UserName,   :PassWord
from   PLAT_LOGIN_USER
WHERE   PLAT_CODE=   :PlatCode;
             
if(   sqlca.sqlcode   <   0     ||   sqlca.sqlcode   >   0   )
{
printf(   "ERROR:   Read   plat   info   from   DB.\n "   );
EXEC   SQL   ROLLBACK   WORK   RELEASE;
exit(-1);
}
/* EXEC   SQL   ROLLBACK   WORK   RELEASE;   */

HostName.arr[HostName.len]   =   '\0 ';
UserName.arr[UserName.len]   =   '\0 ';
PassWord.arr[PassWord.len]   =   '\0 ';
       
nRet   =   EncodeAndDecode(   (char   *)PassWord.arr   );
        PassWord.len   =   strlen((char   *)   PassWord.arr);

nRet   =   HandleDbName(   (char   *)HostName.arr   );
        HostName.len   =   strlen((char   *)   HostName.arr);

        if(   connDB((char   *)UserName.arr,   (char   *)PassWord.arr,
(char   *)HostName.arr)   !=   0   )
{
printf(   "ERROR:   Connect   to   Second   DB.\n "   );
return   -1;
}

        printf(   "Second   Connected   to   ORACLE   success.\n "