472,805 Members | 989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Oracle Pro-C supports long long data type?

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
12 9350
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
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
"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
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
"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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vikash Jain | last post by:
I have just completed installing Oracle 9.2.0.2 client on an HP Alpha Open VMS system. I used the custom install and installed almost everything. At the end of install the following message was...
1
by: John De Lello | last post by:
Hello Everyone, I am trying to install Oracle 9 on my Windows XP Pro laptop so I can play around. I downloaded the 3 ZIP files specified on the Oracle site (92010NT_Disk1.zip) and unzipped them...
3
by: Tamer | last post by:
Hi! I followed the installation instructions from the oracle 9i built in documentation and started the installation with the Result of this output on my Xconsole: Error occurred during...
1
by: Dominic | last post by:
Hi, I am TOTALLY new to all this stuff and really hope to find help here. I have to come up with a solution for one of my client. They use HP-UX and Pro/5 What I'm trying to do:
1
by: Eranut | last post by:
Hi, I am trying to understand if there is a way to send a table of records (table of structs) from pro C to Oracle pl/sql stored procedure. Since Oracle is demanding definition of the *sent*...
2
by: ANSWER | last post by:
Hi, I've installed Oracle 8i enterprise edition on P-III box which has XP pro(SP1), after installation it worked fine and after I rebotted my box it stopped working and I checked the services...
1
by: ian m via SQLMonster.com | last post by:
Hi, I currently have a ms access update query that runs perfectly well and quicly in access however I now need to add this query to convert this qeryu to oracles equivelant sql syntax and add it...
2
by: baumann.Pan | last post by:
Dear all , how can I connect to oracle database in C language under linux? thanks in advance
1
by: Golan | last post by:
Hi, I have a PRO*C code that may run also on PCs where Oracle is not installed. In this case ofcourse the code that read & write from the database should be ignored. What should I specify in the...
0
by: tickle | last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2 * copybook - celg02u3.sql SIR 24265 * * updates dt_deny for all rows in * * ...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.