Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tough C++/Oracle Solution???

Status
Not open for further replies.

DCCoolBreeze

Programmer
Jul 25, 2001
208
US
1. I have a table in Oracle that contains a NUMERIC field
2. I INSERT the variable unsigned long long llValue[3] into
the numeric field by INSERT ....
Values(llValue[0] | llValue[1] | llValue[2]);
This works great...

Now the problem...
How can I read this variable back into the array? I have tried several things without success. I have tried char strings, byte strings, the array and structures. I am beginning to believe that it can not be done...

Anyone out there know who to do this??
 
I understand the insert I did better now. I thought that the value[0] || value[1] || ... would actually concatenate the bytes of value [0] and value[1]...for example.

value[0] = 1
value[1] = 2
value = hex 0x0201 = 513
This is not the case. The value saved in to field is 12.

I need to save a 128+bit value to a NUMERIC field and them extract it.
 
On a related note, I loathe Oracle's OCI and Pro*C/C++. I came across a freeware template library called "OTL" that has been around since 1996 and is very easy to use. I find that I can interface with Oracle 8i on AIX 4.3.3 with very little code.

As a plus, if I need to interface with a DB2 or ODBC database then I have that as an option with the same library.

See for details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top