On Sat, 29 Sep 2007 01:26:32 +0200
Tommi Mäkitalo <[EMAIL PROTECTED]> wrote:

> Hi Mark,
> 
> I'm just testing your patches regarding decimal- and 32/64-bit
> integer support in tntdb and have problems with your
> oracle-number-implementation. It does not work here. It may have to
> do with endianess since I'm testing on AIX on Power, which has big
> endian instead of little like on x86.

Hello Tommi,

Great, thanks for merging the changes.

I brought my local tntdb copy up to date svn update, check
the conflicts, svn revert, etc.  It all seemed fine except that
it needs the following diffs in order for Oracle numbers to
print as strings:

goanna% svn diff tntdb
Index: tntdb/src/oracle/value.cpp
===================================================================
--- tntdb/src/oracle/value.cpp  (revision 67)
+++ tntdb/src/oracle/value.cpp  (working copy)
@@ -470,10 +470,14 @@
           break;

         case SQLT_FLT:
-        case SQLT_NUM:
           ret = toString(doubleValue);
           break;

+        case SQLT_NUM:
+        case SQLT_VNU:
+          ret = number.getDecimal().toString();
+          break;
+
         default:
           ret = data.data();
       }
goanna%

Can you please try that?

Are there any other problems after applying the above diff?

If there are, can you please send me the output of:

env | egrep "(LANG|LC_)"

> I looked at your implementation and wonder, why don't you use
> OCINumber but vnum[OCI_NUMBER_SIZE]?

The reason is that OCINumber does not provide any methods
to convert to and from 64 bit integers.

> In tntdb::oracle::Datetime I use
> OCIDatetime and I feel, that it should work with OCINumber too.

So do I, I agree, it seems crazy that we have to work with
this arcane (cryptic or obscure) vnum[OCI_NUMBER_SIZE].
Unfortunately though OCINumber seems kind of useless.

I considered something like:

int64_t => string => OCINumber => vnum[OCI_NUMBER_SIZE]

vnum[OCI_NUMBER_SIZE] => OCINumber => string => int64_t

and writing the conversions from int64_t to string, and
string to int64_t.  Oracle would do the other conversions.

Converting strings to numbers and vice versa though does not
seem much easier than doing the vnum[OCI_NUMBER_SIZE] conversions.

I am not aware of any other freeware C or C++ database libraries that
support 64 bit or decimal numbers with Oracle.  Before writing
this vnum[OCI_NUMBER_SIZE] code, I did google searches looking for
any existing implementations, but I could not find any.

> The code is in svn. I have made some hopefully minor changes.
> 
> Tommi

Thanks, I will try to fix any problems.

Thanks, Mark

-- 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to