C/C++ code#include
#include
#include
#pragma comment (lib, "oraocci11d.lib")
using namespace std;
int SelectFrom (char *sqlexec);
int main ()
{
char a[] = {"SELECT * FROM AAVARX"};
int b = SelectFrom (a);
cout<
system ("pause");
return 0;
}
int SelectFrom (char *sqlexec)
{
oracle::occi::Environment *env = oracle::occi::Environment::createEnvironment ();
oracle::occi::Connection *coon = env ->createConnection ("boss", "zzs880905", "shop");
oracle::occi::Statement *stmt = coon ->createStatement (sqlexec);
oracle::occi::ResultSet *res = stmt ->executeQuery ();
res ->next ();
sqlexec = (char *)malloc (strlen (res ->getString (1).c_str ()));
char *temp = strcpy (sqlexec, res ->getString (1).c_str ());
temp = strcat (sqlexec, res ->getString (2).c_str ());
coon ->terminateStatement (stmt);
env ->terminateConnection (coon);
oracle::occi::Environment::terminateEnvironment (env);
cout<
return 0;
}