Re: Looking for examples that call C functions from PL/SQL!

From: Dirk Bellemans <Dirk.Bellemans_at_skynet.belgium>
Date: Fri, 13 Aug 1999 06:32:20 +0200
Message-ID: <7p3agb$ukp$>

Thomas Kyte wrote in message <>...
>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
>the next one... (i myself prefer the type checking I get with the
>>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
>that you always just use short -- not int. Its a short we pass around and
>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 Fri Aug 13 1999 - 06:32:20 CEST

Original text of this message