====寫入資料**********==
create or replace procedure addwate***ll
isdirections clob;
amount binary_integer;
offset integer;
first_direction varchar2(1000);
more_direction varchar2(1000);
begin
--刪除已經存在的同名記錄
delete from wate***lls t where t.falls_name='munising falls';
--插入新行,並建立檔案定位符
insert into wate***lls(falls_name,falls_direction)
values ('munising falls',empty_clob());
--取出檔案定位符
select falls_direction into directions from wate***lls t where t.falls_name='munising falls';
--開啟lob
dbms_lob.open(directions,dbms_lob.lob_readwrite);
--寫入資料
first_direction :='direction ttttttttttt';
amount :=length(first_direction);
offset :=1;
dbms_lob.write(directions,amount,offset,first_direction);
--追加資料
more_direction :='more fffffffffff';
amount :=length(more_direction);
--關閉lob
dbms_lob.close(directions);
end;
*****===讀取資料***************=
create or replace procedure readlobtest
isamounteverytime constant binary_integer := 2;
readsize binary_integer := amounteverytime;
directions clob;
resultstr varchar2(1000);
perstr varchar2(299);
offset integer;
begin
--提取定位符
select t.falls_direction into directions from wate***lls t where t.falls_name='munising falls';
--設定偏移量
offset :=1;
--讀取clob
while(readsize = amounteverytime)
loop
dbms_lob.read(directions,readsize,offset,perstr);
offset := offset+readsize;
resultstr :=concat(resultstr,perstr);
end loop;
dbms_output.put_line(resultstr);
end;
python讀取和寫入mysql
import pymysql import pandas as pd import numpy as np from sqlalchemy import create engine from sqlalchemy.types import nvarchar,float,integer如果是要讀取,有...
xml讀取和寫入
1 需要的命名空間 using system.collections.generic using system.io using system.text using system.xml 3 寫入後的xml檔案樣式 1神州俠侶 5045.55 tiger 以下 為自動建立序號時使用,若你的資料來源本...
檔案讀取和寫入
open 返回乙個檔案物件,open filename,mode f open workfile w 第乙個引數是包含檔名的字串,第二個引數可以是包含一些字元的字串 r 僅讀取檔案,w 僅寫入檔案,a 開啟檔案以進行新增的模式 r 開啟檔案進行讀取和寫入,模式引數是可選的。r 如果省略,將被假定。b...