for(i=0;i<ilnum-isnum;i++) {
vsno[ipos] = isno[i];
vsname[ipos] = sname[i]; ipos = ipos+1; }
cout << "SELECT RESULT IS ..." << endl; for(i=0;i<ilnum;i++) {
cout<<vsno[i]<<" AND "<<vsname[i]<<endl; }
cout << "SELECT RESULT END !" << endl; cout << "SELECT ¨D¨D SUCCESS" << endl; } catch (SQLException ex) { cout << " Error Number : "<< ex.getErrorCode() << endl; cout << ex.getMessage() << endl; }
conn->terminateStatement(stmt); env->terminateConnection(conn);
Environment::terminateEnvironment(env);
cout << "PROGRAM END !" << endl; return 1; }
5.5. MERGE语句的使用
在使用MEGER语句时,USING部分的取值应该使用表或者SELECT param1,param2 FROM DUAL,其中param1,param2是常量值,可以通过数组赋值,并且每列值都应该取别名,在后面的使用中就只用别名。例子如下所示: #include <iostream> #include <occi.h>
using namespace oracle::occi; using namespace std;
int main () {
Environment *env; Connection *conn; Statement *stmt;