Home » Developer & Programmer » Precompilers, OCI & OCCI » occi: No such file or directory -- error: `oracle' has not been declared
occi: No such file or directory -- error: `oracle' has not been declared [message #253506] Tue, 24 July 2007 02:37 Go to next message
chandu2u
Messages: 3
Registered: July 2007
Junior Member
Hi
I tried to compile below program
#include <iostream>
#include <occi>
using namespace oracle::occi;
using namespace std;

main()
{
string usr[100]="ptrqa_daily_dbo";
string pwd[100]="welcome99#";
string SID[100]="";
Environment *env=Environment::createEnvironment();
Connection *conn= env->CreateConnection(usr,pwd,SID);//all strings
Statement *stmt = conn->createStatement("select name from test"); //Optionally you can provide your Query here
stmt->setSQL();
ResultSet *rs = stmt->executeQuery();
while(rs->next()) { getString(column ID)}
rs->getString(1);
try {} catch(exception& ex) { }
cout<<ex.what()<<endl;
}

I got compilation error as

sample.cpp:2:16: occi: No such file or directory
sample.cpp:3: error: `oracle' has not been declared
sample.cpp:3: error: expected namespace-name before ';' token
sample.cpp:3: error: `<type error>' is not a namespace

Pls help in resolving thie error



Re: occi: No such file or directory -- error: `oracle' has not been declared [message #253530 is a reply to message #253506] Tue, 24 July 2007 03:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As far as I know, include files are like '*.h'

Regards
Michel
Re: occi: No such file or directory -- error: `oracle' has not been declared [message #253607 is a reply to message #253530] Tue, 24 July 2007 07:05 Go to previous messageGo to next message
chandu2u
Messages: 3
Registered: July 2007
Junior Member
I tried by converting occi to occi.h still i m getting same error
Re: occi: No such file or directory -- error: `oracle' has not been declared [message #253627 is a reply to message #253607] Tue, 24 July 2007 07:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Now if you don't have Oracle include files directory in your default path list for include files you have to give the full path.

Regards
Michel
Re: occi: No such file or directory -- error: `oracle' has not been declared [message #253862 is a reply to message #253627] Wed, 25 July 2007 02:30 Go to previous messageGo to next message
chandu2u
Messages: 3
Registered: July 2007
Junior Member
Thx a lot it worked but it giving new error in occi.h as below

occiControl.h:572: error: looser throw specifier for `virtual oracle::occi::SQLException::~SQLException()'
/sbcimp/run/pd/gcc/3.4.2-32bit/lib/gcc/i686-pc-linux-gnu/3.4.2/include/c++/exception:56: error: overriding `virtual std::exception::~exception() throw ()'

Pls help in resolving this error
Re: occi: No such file or directory -- error: `oracle' has not been declared [message #269198 is a reply to message #253862] Fri, 21 September 2007 02:17 Go to previous message
sanjoykumar.n@hcl.in
Messages: 2
Registered: September 2007
Location: Bangalore
Junior Member
hi guy... U test below Code... It vil worl Fine...


#include <iostream>
#include <occi.h>
using namespace oracle::occi;
using namespace std;

main()
{
string usr[100]="ptrqa_daily_dbo";
string pwd[100]="welcome99#";
string SID[100]="";
Environment *env=Environment::createEnvironment();
Connection *conn= env->CreateConnection(usr,pwd,SID);//all strings
Statement *stmt = conn->createStatement("select name from test"); //Optionally you can provide your Query here
stmt->setSQL();
ResultSet *rs = stmt->executeQuery();
while(rs->next()) { getString(column ID)}
rs->getString(1);
try {} catch(SQLException ex)
{
cout<<ex.what()<<endl;
}
}


cheers,
sanju
Previous Topic: Getting the actual length for column
Next Topic: pro*c confirmation
Goto Forum:
  


Current Time: Fri Mar 29 10:39:11 CDT 2024