Home » Developer & Programmer » Precompilers, OCI & OCCI » OCCI Datatypes
OCCI Datatypes [message #178834] Fri, 23 June 2006 01:14 Go to next message
achintk
Messages: 2
Registered: June 2006
Junior Member
Hi all

I am new to C++ and OCCI. I have a database table field that is defined as NUMBER(7,2). Which primitive datatype should I use in C++ inorder to retrieve the value so that I don't loose the precision.

Thanks in advance.

Achint
Re: OCCI Datatypes [message #179050 is a reply to message #178834] Sat, 24 June 2006 04:42 Go to previous messageGo to next message
raom
Messages: 22
Registered: January 2006
Location: india
Junior Member
u can use long .
Re: OCCI Datatypes [message #187673 is a reply to message #178834] Mon, 14 August 2006 20:39 Go to previous message
yifanernei
Messages: 4
Registered: August 2006
Location: china
Junior Member
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 coldata = num.toText(env, fmt);


Here is my code by occi,but maybe it's too complex to build the fmt.

[Updated on: Mon, 14 August 2006 20:41]

Report message to a moderator

Previous Topic: Need 10g - (10.1.0.4 ) version Pro*C/C++ Precompiler
Next Topic: proc help?
Goto Forum:
  


Current Time: Thu Mar 28 14:57:37 CDT 2024