Getting long raw data into a clob variable

I want to get long raw data from a column that has a long raw data type in a clob variable.

If I write the insert statement directly, I cannot insert into a long raw column.

I need to use the utl_raw.cast_to_raw (..) function to insert text into a long raw column. Can someone explain this problem?

Let me explain the workflow for this.

  • The user enters formatted text in an advanced editor in Delphi and saves.

  • Data is stored in a long raw column.

  • The user presses a button in Delphi, and the data must be retrieved from a long raw column and displayed in an advanced editor.

So, all we need is SQL, which passes the identifier, and it should return data from a long raw.

This works, but the data is not readable, since we get binary garbage data.

The table structure for this table will be similar to creating table data (id integer, data long raw);

I am using oracle 9i as a database.

+1
source share
1 answer

The LONG and LONG RAW data types are deprecated in favor of CLOB and BLOB with Oracle 8.0 (i.e., almost fifteen years ago). The main reason for this switch is that the LONG speakers have difficulty working and this doubles for LONG RAW.

As you have already discovered, there is a limitation on what we can do in PL / SQL. This limit is 32K. Large LONG RAW columns can only be processed in C.


Tom Kyte used a utility to unload Long Raw columns into a flat file, which could then be loaded into modern LOB columns through SQL Loader. This utlity is apparently not available (it is not in the list of / ~ tkyte files in his blog).

However, Fangxin Lou wrote a version of another Tom Kyte utility, which he called ociuldr , which apparently handles Long Raw. You can download the source from your website.

+1
source

Source: https://habr.com/ru/post/1386881/


All Articles