Hi,
I've been trying to INSERT a new row which includes a BFILE reference to an external BMP image file. The target column ( empimage ) for this image file is of type BLOB. I want to know if I can do this using an INSERT command rather than DBMS_LOB. A basic example of what I am trying and the subsequent error is as follows:
DECLARE
v_emp_nr employee.employee_nr%TYPE := &employee_nr ;
BEGIN
INSERT INTO employee ( employee_nr, surname, job, sex, department_nr, salary, start_date, empimage )
VALUES ( v_emp_nr , 'Smith','Clerk', 'F', 10, 2000, sysdate, BFILENAME ( 'BFILEDIR' ,'OldDearHunter.bmp' ) ) ;
END ;
/
Error:
VALUES ( v_emp_nr , 'Smith','Clerk', 'F', 10, 2000, sysdate, BFILENAME ( 'BFILEDIR' ,'
*
ERROR at line 8:
ORA-06550: line 8, column 83:
PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got FILE
Any definitive rules on carrying out this sort of thing would be gratefully received
I've been trying to INSERT a new row which includes a BFILE reference to an external BMP image file. The target column ( empimage ) for this image file is of type BLOB. I want to know if I can do this using an INSERT command rather than DBMS_LOB. A basic example of what I am trying and the subsequent error is as follows:
DECLARE
v_emp_nr employee.employee_nr%TYPE := &employee_nr ;
BEGIN
INSERT INTO employee ( employee_nr, surname, job, sex, department_nr, salary, start_date, empimage )
VALUES ( v_emp_nr , 'Smith','Clerk', 'F', 10, 2000, sysdate, BFILENAME ( 'BFILEDIR' ,'OldDearHunter.bmp' ) ) ;
END ;
/
Error:
VALUES ( v_emp_nr , 'Smith','Clerk', 'F', 10, 2000, sysdate, BFILENAME ( 'BFILEDIR' ,'
*
ERROR at line 8:
ORA-06550: line 8, column 83:
PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got FILE
Any definitive rules on carrying out this sort of thing would be gratefully received