By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 1,837 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

Oracle Pro-C supports long long data type?

P: n/a
Hi,
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code -1460,
any idea about this?
thx

Jun 15 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a
ed
On 15 Jun 2006 12:59:27 -0700
"we*****@yahoo.com" <we*****@yahoo.com> wrote:
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code
-1460, any idea about this?


What does

sizeof( long long int ) * 8 report?

Should be 64. If Oracle cannot support bigint(64, or 128) bits wide,
then it's got right to complain.

Can you give a sample of the error? Also, what's wrong with the GNU
compiler?

--
Regards, Ed :: http://www.linuxwarez.co.uk
just another linux person
Say NO to LONGHORN/VISTA -- google this: "how microsoft is selling
out the public to please hollywood"
Jun 15 '06 #2

P: n/a
ed <ed@noreply.com> writes:
On 15 Jun 2006 12:59:27 -0700
"we*****@yahoo.com" <we*****@yahoo.com> wrote:
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code
-1460, any idea about this?


What does

sizeof( long long int ) * 8 report?

Should be 64.


Only if char is 8 bits. That is not always the case. For instance,
many DSPs have 32-bit char.

--
Måns Rullgård
mr*@inprovide.com
Jun 15 '06 #3

P: n/a
"we*****@yahoo.com" <we*****@yahoo.com> writes:
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code -1460,
any idea about this?


If a compiler doesn't support long long, it should fail to compile any
program that uses it. If you're getting a runtime error, something
else is going on. Perhaps the compiler supports long long but the
runtime library doesn't. We have no idea what "error code -1460"
might mean, and we can't guess what the problem is without seeing
actual code.

Try these programs:

========================================
#include <stdio.h>
#include <limits.h>
int main(void)
{
printf("long long is %d bits\n", (int)sizeof(long long) * CHAR_BIT);
return 0;
}
========================================
(output should be "long long is 64 bits")

========================================
#include <stdio.h>
int main(void)
{
long long x = 42;
printf("x = %d\n", (int)x);
return 0;
}
========================================
(output should be "x = 42")

========================================
#include <stdio.h>
#include <limits.h>
int main(void)
{
long long x = LLONG_MAX;
printf("x = %lld\n", x);
return 0;
}
========================================
(output should be "x = 9223372036854775807")

The correct output may vary in the unlikely event that long long is
bigger than 64 bits.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 15 '06 #4

P: n/a
In comp.unix.programmer Måns Rullgård <mr*@inprovide.com> wrote:
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006
.... What does

sizeof( long long int ) * 8 report?

Should be 64.
Only if char is 8 bits. That is not always the case. For instance,
many DSPs have 32-bit char.


I doubt that any are running Oracle.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Jun 15 '06 #5

P: n/a
"we*****@yahoo.com" wrote:

I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code
-1460, any idea about this?


I suggest you look up that error in your Oracle documentation.
Then take appropriate action. I doubt that that compiler is C99
compliant. Or it may need another library to execute such things.

--
Some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html
Jun 15 '06 #6

P: n/a
we*****@yahoo.com wrote:
Hi,
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code -1460,
any idea about this?
thx


<Point of Clarification>
For the benefit of group members who've responded. Pro-C is a
precompiler. You write C code with embedded SQL statements as per the
Pro-C spec. Then use Pro-C to precompile the code to generate pure C
with the SQL replaced with calls to Oracle's libraries and then compile
the C.
</Point of Clarification>

For the OP...

<insert from the 8.1.7 Pro-C programmer's manual>
Table 4-4 shows the C datatypes and the pseudotypes that you can use
when declaring host variables. Only these datatypes can be used for
host variables.
Table 4-4 C Datatypes for Host Variables
C Datatype or Pseudotype Description

char single character

char[n] n-character array (string)

int integer

short small integer

long large integer

float floating-point number

double floating-point number

VARCHAR[n] variable-length string
</insert>

"long long" is not supported. You can use them if you do the
conversion youself through a char[]. To store you sprintf to a char[]
host variable and use the char[] in the SQL. When fetching fetch into
a char[] host variable and then sscanf (or other) to convert the string
to long long.

-- ced
--
Chuck Dillon
Manager of Software Development, Bioinformatics
NimbleGen Systems Inc.
Jun 16 '06 #7

P: n/a
In comp.unix.programmer Chuck Dillon <sp**@nimblegen.com> wrote:
we*****@yahoo.com wrote:
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code -1460,
any idea about this?

<Point of Clarification>
For the benefit of group members who've responded. Pro-C is a
precompiler. You write C code with embedded SQL statements as per the
It's useful here to distinguish between a precompiler and a preprocessor.

Pro*C parses the code to extract type information from it. Generally
speaking, Pro*C's parser is a little fragile (has been slow to incorporate
nicities such as allowing user's #define's).
"long long" is not supported. You can use them if you do the


"long long" is a C9X feature, and Oracle 8.1.7 (note the copyright date)
is rather old. It would be interesting to see if a current version of
Oracle's Pro*C recognizes long long.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Jun 17 '06 #8

P: n/a
Thanks Tom, that is what I want to know. I did used Oracle Proc-C
precompiler to do pre-compilation but it cannot inteprete long long
correctly and it treats "long long" as long instead which is incorrect.

Thomas Dickey wrote:
In comp.unix.programmer Chuck Dillon <sp**@nimblegen.com> wrote:
we*****@yahoo.com wrote:

I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code -1460,
any idea about this?

<Point of Clarification>
For the benefit of group members who've responded. Pro-C is a
precompiler. You write C code with embedded SQL statements as per the


It's useful here to distinguish between a precompiler and a preprocessor.

Pro*C parses the code to extract type information from it. Generally
speaking, Pro*C's parser is a little fragile (has been slow to incorporate
nicities such as allowing user's #define's).
"long long" is not supported. You can use them if you do the


"long long" is a C9X feature, and Oracle 8.1.7 (note the copyright date)
is rather old. It would be interesting to see if a current version of
Oracle's Pro*C recognizes long long.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


Jun 18 '06 #9

P: n/a
In comp.unix.programmer we*****@yahoo.com <we*****@yahoo.com> wrote:
Thanks Tom, that is what I want to know. I did used Oracle Proc-C
precompiler to do pre-compilation but it cannot inteprete long long
correctly and it treats "long long" as long instead which is incorrect.


But it's an old version.
A more recent version, e.g., one released after C9X, might support long long.

Oracle 10 has been available for a while.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Jun 19 '06 #10

P: n/a
We are using the Oracle pre-complier as stated in my original question.
Until the upgrade of pre-compiler for our system, it is impossible for
us to use long long at his point. thx anyway.

Thomas Dickey wrote:
In comp.unix.programmer we*****@yahoo.com <we*****@yahoo.com> wrote:
Thanks Tom, that is what I want to know. I did used Oracle Proc-C
precompiler to do pre-compilation but it cannot inteprete long long
correctly and it treats "long long" as long instead which is incorrect.


But it's an old version.
A more recent version, e.g., one released after C9X, might support long long.

Oracle 10 has been available for a while.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


Jun 19 '06 #11

P: n/a
Thomas Dickey wrote:
"long long" is not supported. You can use them if you do the

"long long" is a C9X feature, and Oracle 8.1.7 (note the copyright date)
is rather old. It would be interesting to see if a current version of
Oracle's Pro*C recognizes long long.


The 10g Pro*C manual describes support for the same "host variable"
datatypes as 8.1.7. IOW, still no long long support.

-- ced
--
Chuck Dillon
Manager of Software Development, Bioinformatics
NimbleGen Systems Inc.
Jun 19 '06 #12

P: n/a
ed wrote:
On 15 Jun 2006 12:59:27 -0700
"we*****@yahoo.com" <we*****@yahoo.com> wrote:
I am using following Oracle Proc-C compiler:
Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

I like to use "long long" integer type(64 bit), but it seems that
Oracle doesn't like it after execution, and giving me error code
-1460, any idea about this?


What does

sizeof( long long int ) * 8 report?

Should be 64.


No. It may be more or less than 64.

For example, it may be more than 64 if 'long long' has more than 64
bits. This is quite consistent with the following types:
8-bit char (1 byte)
16-bit short (2 bytes)
32-bit int (4 bytes)
64-bit long (8 bytes)
128-bit long long (16 bytes)
So sizeof(long long)*8 == 128 in this case.

It may be less than 64 if the platform has CHAR_BIT greater than 9.

This is consistent with the following types:
10-bit char (1 byte)
20-bit short (2 bytes)
20-bit int (2 bytes)
40-bit long (4 bytes)
70-bit long long (7 bytes)
So sizeof(long long)*8 == 56 in this case.

Or even:
32-bit char (1 byte)
32-bit short (1 byte)
32-bit int (1 byte)
32-bit long (1 byte)
64-bit long long (2 bytes)
So sizeof(long long)*8 == 16 in this case.

--
Simon.
Jun 27 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.