In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Create test directories and files on the database host
$mkdir / test
$cd / test
$echo "Test Subject" > > subject.html
$echo "test ok!" > > mail.html
Define the file path (all on the database host) and authorize
$sqlplus user/passwd@instance
SQL > create or replace directory send_file_dir as'/ test'
SQL > grant read on directory send_file_dir to test1
The following is the insert into the emailed table (there are two blob fields subject,message in the table)
$sqlplus user/passwd@instance
SQL > declare
Destloc blob
Destmsg blob
Srcfile bfile:=BFILENAME ('SEND_FILE_DIR','subject.html')
Msgfile bfile:=BFILENAME ('SEND_FILE_DIR','mail.html')
BEGIN
Insert into email_send values (seq_email_id.nextval,null,'test@163.com',null,null,empty_blob (), empty_blob (), sysdate,null,'waiting',0,'HTML',null)
Returning subject,message into destloc,destmsg;-if more than one blob field is added here.
Dbms_lob.fileopen (srcfile)
Dbms_lob.loadfromfile (destloc,srcfile,dbms_lob.getlength (srcfile))
Dbms_lob.fileclose (srcfile)
Dbms_lob.fileopen (msgfile)
Dbms_lob.loadfromfile (destmsg,msgfile,dbms_lob.getlength (msgfile))
Dbms_lob.fileclose (msgfile)
Commit
END
/
This inserts two blob fields into the table email_send.
Subject field content is subject.html
Message field content is mail.html
Error message
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
No such file or directory
ORA-06512: at "SYS.DBMS_LOB", line 805
ORA-06512: at line 9
Solution method
These files are on the database host, if there are no these files on the host will report an error. Create directories and files on the host on the ok, I have not found a way to read files remotely, if any brother knows, tell me, thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.