0
votes
Create TABLE long_claw
(
    "name" varchar2(10),
    phno number(10),
    clg_docs blob
)
partition by hash(phno);

insert into pepe.long_claw("name",phno,clg_docs)
values('Satyajit',9176788770,to_lob('ceb'));

When I tried to execute the insert statement I got the following error:

Error starting at line : 9 in command -

insert into pepe.long_claw("name",phno,clg_docs)
values('Satyajit',9176788770,to_lob('ceb'))

Error at Command Line : 10 Column : 30

Error report -

SQL Error: ORA-00932: inconsistent datatypes: expected - got CHAR 00932. 00000 - "inconsistent datatypes: expected %s got %s"

*Cause:

*Action:

I need some help here.

2
Please format code and error message as code. Furthermore, as long as you don't tell which database software you are using, we probably can't help you. - Binarus

2 Answers

0
votes

TO_LOB converts LONG or LONG RAW values to LOB values. So you cannot directly use a string to convert it to LOB . Instead use hextoraw() OR utl_raw.cast_to_raw()

INSERT INTO long_claw("name",phno,clg_docs)
VALUES('Satyajit',9176788770,hextoraw('ceb'));


INSERT  INTO  long_claw("name",phno,clg_docs)
VALUES('Satyajit',9176788770,utl_raw.cast_to_raw('ceb'));
-1
votes

you need create procedure

create or replace procedure proc_name(na in varchar2, ph in number, clg_doc in blob)
begin 
inser into pepe.long_claw("name",phno,clg_docs) values 
(na, ph, clg_doc);
end;

and call it procedure