Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Looking for examples that call C functions from PL/SQL!
Thomas Kyte wrote in message <37b5ab1f.59156993_at_newshost.us.oracle.com>...
>A copy of this was sent to "Dirk Bellemans" <Dirk.Bellemans_at_skynet.belgium>
>(if that email address didn't require changing)
It does, but the change is straightforward. I have to pay for my own connection time....
>many compliers on the other hand (if portability is important) will not
process
>the next one... (i myself prefer the type checking I get with the
following
>prototype)...
>
>>Modern c(++) requests a declaration as follows:
>>
>>long __declspec(dllexport)
>>OutputString (
>> OCIExtProcContext* context ,
>> char* path,
>> short path_ind,
>> char* message,
Well, like I wrote *modern* c(++) requests the declaration I gave. I you use an old compiler, you can't use recent constructs, can you? Actually, you could even use c++ IF you provide a c wrapper function. Makes programming much easier than with straight c.
>In the case of in/out variables, path_ind would be a short *. It is
recommended
>that you always just use short -- not int. Its a short we pass around and
while
>it might get promoted to int on the stack, since we frequently pass
pointers to
>it -- you should just keep it short.
Thank you for the explanation. I was only pointing out that "short" is an datatype that is rarely used in modern c(++). We can't, of course, expect library writers to modify their interfaces with every fashion change ;-) My opinion still stands for local variables: int (and for non-ints: double) are by far the preferred data types. I'd use int everywhere but the interface, but I'm a purist...
--
Dirk Bellemans
Modify email address to reply (use .be instead of .belgium)
Received on Thu Aug 12 1999 - 23:32:20 CDT
![]() |
![]() |