title: Pro-C buffer types compatible with a CLOB
body: <p>I'm attempting to use a CLOB in Pro-C, but pretty much no matter what I try for a buffer data type, the preprocessor tells me it's not compatible.</p>
  
  <p>The message is </p>
  
  <pre><code>PCC-S-02428, Buffer type is incompatible with LOB type,
  </code></pre>
  
  <p>and it's on a line that reads:</p>
  
  <pre><code>EXEC SQL LOB READ :amount FROM :clob into :buffer;
  </code></pre>
  
  <p>This code is my attempt to modify code that works with a BLOB to instead work with a CLOB.  I altered the declaration of the locator from OCIBlobLocator to OCIClobLocator, and then have beat my brains out trying to figure out what I need to declare the buffer as (unsigned char buffer[ BUFFSIZ ] worked for the BLOB).</p>
  
  <p>As it sits right now:</p>
  
  <p>clob is declared as follows:</p>
  
  <pre><code>OCIClobLocator *clob;
  </code></pre>
  
  <p>and buffer is:</p>
  
  <pre><code>#define BUFFSIZ 1000000
  unsigned char buffer[ BUFFSIZ ];
  </code></pre>
  
  <p>I've tried char, int, double, long. ulong_varchar, short, utext, uvarchar, varchar in various combinations of pointers (e.g.,, short *buffer), sized array declarations, straight declarations (e.g., uvarchar buffer), and both signed and unsigned.  For all cases where the buffer declaration is itself legal, the READ INTO statement fails to compile with this message.</p>
  
  <p>Actually entering the text of the message into google leads me to an Oracle page that simply restates the message (rather than being so helpful as to actually list compatible types).  The Oracle tutorials all focus on BLOBs, no example is of a CLOB.</p>
  
  <p>The closest thing I found to an answer was here on Stack Overflow (kudos!).  This question: <a href="https://stackoverflow.com/questions/39741891/selecting-clob-in-oracle-using-c-and-embedded-sql">Selecting CLOB in Oracle using C and embedded SQL</a></p>
  
  <p>was from someone else having the same issue.  He claims to have solved it by removing the CHAR_SET=STRING parameter from his command line invocation of PRO-C.  The problem is, Pro-C here doesn't even recognize that such an option exists...so I can't remove it, because I'm not using it.  (I tried to point this out there, not realizing I was misusing this forum and it was (justly) deleted...my apologies to whomever had to clean up my mess.)</p>
  
  <p>My version of Pro*C/C++ is 11.2.0.1.0</p>
  
  <p>The options I am running are</p>
  
  <pre><code>PARSE=NONE CODE=CPP CPP_SUFFIX=cpp MODE=ORACLE LINES=YES THREADS=YES
  </code></pre>
  
  <p>And as I mentioned earlier, the exact same thing (except for declaring an OCIBlobLocator and renaming various variables from blob_something to clob_something does compile and function.</p>
  
  <p>I unfortunately cannot post the code because it's on an airgapped system and permission for a file transfer would take a writ from a much higher power than me.</p>