The first error message you're getting is because utl_raw.cast_to_varchar2 requires a raw datatype as input parameter and you're giving it a clob.
The second error message you're getting because you're trying to put text data in a binary datatype (blob).
Read the documentation about clob and blob and their differences.
If you are going to store text, you want to use the clob datatype. It makes no sense to store it as a blob, because you would have to convert it back and forth between character and binary data.
To store a clob in a table by passing it to a procedure, try something like:
create or replace procedure insert_clob( p_clob clob ) is
insert into gh values (p_clob);
Which is simply a pl/sql wrapper around an sql statement. There is still a lot missing here, e.g. there is no primary key in the gh table.
Can you tell a bit more about your requirements? Where is the data coming from? What kind of interface/front end are you using? What is the process behind this requirement?
This is just a duplicate of your existing question. : how to split the blob byte array and insert in oracle
DO NOT start a new discussion asking the same thing as not everyone will know what answers and help you've already had, and that can waste people's time if they are just giving you answers you've already had.
Locking this thread