Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error inserting new row using BFILE

Status
Not open for further replies.

bogman

Instructor
Jan 15, 2002
13
0
0
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top