Re: How Do You Insert Long Raw Data?

From: EndUser <enduser_at_enduser.com>
Date: 1996/01/29
Message-ID: <enduser-2901962150190001_at_dial-sc1-11.iway.aimnet.com>#1/1


point is, you need to pass apointer to the data you want inserted. raws are acutally pointers to page data in the table. thus, you dont store data in the table itself. how you tet the data into the page is a function of the type and size of the data, not the raw data type.

--

In article <4ek57d$c5p_at_inet-nntp-gw-1.us.oracle.com>, surman_at_oracle.com
(Scott Urman) wrote:


> In article <3107D13E.3A78_at_bearriver.com>, Allan Hoeltje
<ahoeltje_at_bearriver.com> writes:
> |> I posted this before but got no answer. Since I think it is a valid
> |> question and one which should be covered in an Oracle manual but isn't,
> |> I am re-posting it in the hope that MAYBE someone at Oracle will answer
> |> it.
> |>
> |> I am trying to store a large binary object in a column defined with the
> |> LONG RAW data type. I am using OCI from a Macintosh C++ program. I am
> |> currently using Oracle 6 but will be moving to Oracle 7 as soon as
> |> it arrives, which was supposed to be last month but that is another
> |> story.
> |>
> |> The book says RAW field values must be represented as quoted hexadecimal
> |> strings in the INSERT statement, for example:
> |>
> |> INSERT INTO tbl (f1,f2,rawField) VALUES
(42,'xyz','5B5261775F446174615D');
> |>
> |> This also means that a 100 byte object now becomes a 200 byte string.
> |>
> |> Oracle 6 is limited to 255 byte quoted strings within the INSERT statement
> |> but I have read that Oracle 7 has increased this limit to 2000 bytes.
> |>
> |> Being as there is a limit on how large the quoted string can be, how
> |> do I insert a really large raw value? Can I get around this size
> |> limitation if I use a place holder in the INSERT statement? Such as:
> |>
> |> unsigned char * raw_data;
> |> // allocate 2000 bytes for raw_data and initialize it with whatever
> |> osql3( &curs, "INSERT INTO tbl (f1,f2,rawField) VALUES
(42,'xyz',:RAW)", -1 );
> |> obndrv( &curs, ":RAW", -1, raw_data, 2000, SQLT_LRAWHR, ... );
> |>
> |> Furthermore, if I use obndrv() to bind the raw value to a place holder
> |> does the program variable "raw_data" need to be converted to a

> |> hexadecimal character string?
> |>
> |> -Allan
> You are correct - use a bind variable. It does not have to be a text string.
> There is an external datatype for LONG RAW - 24. Use this for the ftype
> parameter of obndrv(). It shouldn't be in hex - it should be the actual
> raw data.
Received on Mon Jan 29 1996 - 00:00:00 CET

Original text of this message