Oracle Pro-C supports long long data type?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Oracle Pro-C supports long long data type?




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Oracle Pro-C supports long long data type?  
wenmang@yahoo.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 12:25 AM

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






[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
ed


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 12:25 AM

On 15 Jun 2006 12:59:27 -0700
"wenmang@yahoo.com" <wenmang@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"





[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
Måns Rullgård


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 12:25 AM

ed <ed@noreply.com> writes:

> On 15 Jun 2006 12:59:27 -0700
> "wenmang@yahoo.com" <wenmang@yahoo.com> wrote:
> 
>
> 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
mru@inprovide.com





[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
Keith Thompson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 12:25 AM

"wenmang@yahoo.com" <wenmang@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) kst-u@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.





[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
Thomas Dickey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 12:25 AM

In comp.unix.programmer Måns Rullgård <mru@inprovide.com> wrote: 
...[vbcol=seagreen] 
[vbcol=seagreen]
> 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





[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
CBFalconer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 12:25 AM

"wenmang@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







[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-06 06:32 PM

wenmang@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.





[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
Thomas Dickey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 06:29 PM

In comp.unix.programmer Chuck Dillon <spam@nimblegen.com> wrote:
> wenmang@yahoo.com wrote:
 
[vbcol=seagreen]
> <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





[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
wenmang@yahoo.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-18-06 06:20 PM

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 <spam@nimblegen.com> wrote: 
> 
> 
>
> 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 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






[ Post a follow-up to this message ]



    Re: Oracle Pro-C supports long long data type?  
Thomas Dickey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-19-06 12:24 PM

In comp.unix.programmer wenmang@yahoo.com <wenmang@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





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:44 PM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register