LONG and LONG RAW

From: Howard Ship <hship_at_sw.stratus.com>
Date: 2 Jul 1993 15:34:52 GMT
Message-ID: <211kis$iqb_at_transfer.stratus.com>


I'm using Embedded SQL Pro*C, on a Sun4 with Oracle version 6.

I've succesfully inserted a row into my table containing a LONG RAW column. To do this, I took my buffer and build a VARCHAR from it, twice as large, plus the space for the length field, then inserted a pair of hex digits for each byte of my input column. Here are some extracts ...

exec sql begin declare section;
  varchar *textAtom;
exec sql end declare section;

static void
buildTextAtom (Buffer text)
{

  char			*input;
  char 			*output;
  int			i;
  int			textBytes;
  static char		hex[] = "0123456789ABCDEF";

  textBytes = cssBufferUsed (text);

  cssBufferAlloc (textAtomBuffer, sizeof (unsigned short) +

                  2 * textBytes);

  textAtom = cssBufferStorage (textAtomBuffer);

  textAtom->len = 2 * textBytes;
  output = textAtom->arr;

  input = cssBufferStorage (text);   

  for (i = 0; i < textBytes; i++) {

/* Convert the top nybble. */

    *(output++) = hex [*input >> 4];

/* Convert the low nybble. */

    *(output++) = hex [*input & 0xf];

    input++;

  } /* for */  

} /* buildTextAtom */

The Buffer typedef, and the cssBufferXXX routines just manage my own style of variable length buffers. cssBufferStorage() returns the address of memory previously alloc'ed.

The seems to work, but in both SQL*Plus and in my other code, I can't do any select this column from the table ...

SQL> select issueNo, atomId from atom;

   ISSUENO ATOMID
---------- ----------

        31          1
        32          1

SQL> SELECT ATOM FROM ATOM;
ERROR:
ORA-01460: unimplemented or unreasonable conversion requested

So now I can store data I can't later read? There must be some way to get at that data. Any pointers, clues, FAQs?

-- 
"Rice Chex!! Wheat Chex!! Rice Chex!! Wheat Chex!!"
Howard_Ship_at_vos.stratus.com
Received on Fri Jul 02 1993 - 17:34:52 CEST

Original text of this message