SQL匯出txt檔案欄位用逗號 ,隔開

2021-06-28 21:55:38 字數 672 閱讀 8796

最近客戶要匯出部分交易明細,格式如下的txt,通過查詢具體sql如下,可以用dbvisualizer或pl/sql匯出。(主要是sql拼接方法||','||)

匯出形如

「04,832005

,20141231

,234915

,23000,1

04,832027

,20141231

,235427

,560 ,1

」的txt檔案,具體sql如下:

select trans_type||','||t.req_serial_no||','||t.req_trans_date ||','||t.req_trans_time||','||(t.amount1+t.amount2+t.amount3+t.amount4) ||','||t.status

from trans_detail t 

where channel='posp'  and trans_type in ('01','04','08','10','26','28','33','40')

and trans_date between to_date('2015-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date('2015-03-01 00:00:00','yyyy-mm-dd hh24:mi:ss');

php匯出txt檔案

願為你通往成功路上的墊腳石 檔名稱 filename urlencode 未提現資訊表 date y m dhis 設定標頭 header accept ranges bytes header content disposition attachment filename filename.txt ...

使用sql指令碼把資料匯出為 txt檔案

sql指令碼部分 sql指令碼部分 demo.sql begin markup html html格式輸出,預設為off autocommit 自動提交insert update delete帶來的記錄改變,預設為off define 識別命令中的變數字首符,預設為on,也就是 碰到變數字首符,後面...

資料匯出到TXT檔案

public static void writetxtfile listexportlist,string filepath,string filename catch exception ex if filepath.endswith filepath filepath filename else...