EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE SQLCA;
cout<<"rint DB Info..."<<endl;
EXEC SQL CONNECT TO BName USER :userid USING :psw;
cout<<"Connected DB\n";
EXEC SQL SELECT REGION,SALES INTO :sRegion,:iSales FROM SALES WHERE SALES=18;
//EXEC SQL COMMIT;
cout<<"Region="<<sRegion<<" Sales="<<iSales<<endl;
char cRegion[16];
strcpy(cRegion,sRegion);
cout<<"cRegion="<<cRegion<<endl;
cout<<"rint DB Info complete\n";
EXEC SQL CONNECT RESET;
//free( inout_sqlda );
}
int main()
{
char ch[1];
PrintStr();
getDB2data();
cout<<"\nPress any key to exit.\n";
cin>;>;ch;
return 0;
}
--------------------------------------------------------------------------
上面代码在prep时:
db2 =>;prep /home/qlw/Sales/Sales.sqC bindfile
报错说不能生成bnd文件,怎么办?作者: steel1991 时间: 2004-06-24 17:27 标题: AIX下DB2预编译嵌入sql的问题 LINE MESSAGES FOR Sales.sqC
------ --------------------------------------------------------------------
SQL0060W The "C++" precompiler is in progress.
SQL0031C File "/home/qlw/Sales/Sales.bnd" could not be
opened.
SQL0095N No bind file was created because of previous
errors.
SQL0091W Precompilation or binding was ended with "2"
errors and "0" warnings.