chalie001
asked on
Error(14,16): PL/SQL: ORA-00904: "IMAGES": invalid identifier
Hi am geting this error after creating directory i did the following
SQL> connect sys /as sysdba
Enter password:
Connected.
SQL> CREATE DIRECTORY IMAGES AS '/u01/images';
Directory created.
SQL> commit;
Commit complete.
SQL> GRANT READ ON DIRECTORY IMAGES TO dba_users;
Grant succeeded.
SQL> commit;
SQL> connect sys /as sysdba
Enter password:
Connected.
SQL> CREATE DIRECTORY IMAGES AS '/u01/images';
Directory created.
SQL> commit;
Commit complete.
SQL> GRANT READ ON DIRECTORY IMAGES TO dba_users;
Grant succeeded.
SQL> commit;
CREATE TABLE NOC_IMAGE_LIABRARY (id NUMBER,IMAGE_name VARCHAR2(50),image BLOB);
create or replace procedure load_images
(
p_id in number,
p_file_name in varchar2
)
is
v_bfile bfile := bfilename( 'IMAGES' , p_file_name);
v_blob blob;
v_src_offset number := 1;
v_dst_offset number := 1;
begin
insert into NOC_IMAGE_LIABRARY (id, file_name, images)
values (p_id, replace(p_file_name,'.png'), empty_blob())
return images into v_blob;
dbms_lob.fileopen(v_bfile, dbms_lob.file_readonly);
dbms_lob.loadblobfromfile(v_blob, v_bfile, dbms_lob.getlength(v_bfile),v_src_offset,v_dst_offset);
dbms_lob.close(v_bfile);
commit;
end;
/
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Open in new window
Open in new window