Home » Developer & Programmer » Precompilers, OCI & OCCI » some problems of occi9 (code)
some problems of occi9 (code) [message #187691] Mon, 14 August 2006 21:43 Go to next message
yifanernei
Messages: 4
Registered: August 2006
Location: china
Junior Member
Hi All

I am new here
I am chinese, so that I am sorry that my Engnlish is poor

winxp + vc6sp6 + oracle9.2

problem:
1.
Dose the ora have a dev and a release edition, so the release edition occi can't work in DEBUG mode? (It's also can compile ,link and run,but would error at free a string or a vector if you use the method getString or getVector.

2.
The mothods of the Class Statement, SetXXX(), have no effect.
Statement * stmt = con->createStatement("select * from :1");
stmt->setString(1, "users");
cout <<stmt->getSQL() <<endl;

I want to get a string "select * from users", but I get still the string "select * from :1".

3.
How can I fetch a NUMBER type data from table and How can I differentiate NUMBER type and Float, DOUBLE type?
Now I use follow code to get the data
int np = md.at(j).getInt(MetaData::ATTR_PRECISION);
int ns = md.at(j).getInt(MetaData::ATTR_SCALE);
Number num = rs->getNumber(j+1);
string fmt;
for (int n=0; n<np; n++)
    fmt += '9';
if (ns > 0)
{
    fmt += '.';
    for (n=0; n<ns; n++)
        fmt += '9';
}
string data = num.toText(env, fmt);

as you see, it's too complex to make the fmt.

"occi guide" says string can also fetch NUMBER,
but only the first line can fetch right, the nexts are wrong

4.
Environment::createEnvironment(mode);
what different from mode, I can't understand the mean from 'occi guide', please give me some simple code



Wish all give me a answer.
I am glad to have your email to discuss occi.
yifanernei@163.com
  • Attachment: TestOCCI.rar
    (Size: 65.42KB, Downloaded 2434 times)

[Updated on: Tue, 15 August 2006 02:08]

Report message to a moderator

Re: some problems of occi9 (code) [message #188163 is a reply to message #187691] Thu, 17 August 2006 05:58 Go to previous messageGo to next message
yifanernei
Messages: 4
Registered: August 2006
Location: china
Junior Member
can anyone help me ?
Re: some problems of occi9 (code) [message #188259 is a reply to message #187691] Thu, 17 August 2006 12:02 Go to previous messageGo to next message
yifanernei
Messages: 4
Registered: August 2006
Location: china
Junior Member
Help
Help
Help
Re: some problems of occi9 (code) [message #189530 is a reply to message #188259] Fri, 25 August 2006 00:52 Go to previous message
kmohan
Messages: 28
Registered: July 2005
Junior Member
1. You may be using the wrong dlls. You can search Oracle forums for this topic. Here is the URL:
http://forums.oracle.com/forums/forum.jspa?forumID=168

2. You are trying to form the sql stmt itself dynamically. You don't have to use bind parameters for that. You could form the sql string as below:
string tab_name = "users"; // or set somehow
string sqlstring = "select * from " + tab_name;

Then
Statement * stmt = con->createStatement(sqlstring);
cout <<stmt->getSQL() <<endl;

3. Are the precision and scale not helpful? What do you need to do?

4. Do you plan to use multi-threading or objects or AQ? Otherwise don't bother about the mode!
Previous Topic: Stack Trace Error - OCCI
Next Topic: When will BatchSQLException be raised?
Goto Forum:
  


Current Time: Sat Nov 23 18:22:17 CST 2024