SAK }‘ŠÙ
Oracle PL/SQL •Ò14 - ‘Sƒe[ƒuƒ‹\‘¢ƒŠƒXƒgƒtƒ@ƒCƒ‹o—ÍAutl_file.put_line
¡‘Sƒe[ƒuƒ‹\‘¢ƒŠƒXƒgƒtƒ@ƒCƒ‹o—Í EUSER_TAB_COLUMNS ‚ð—˜—p‚µ‚ÄA‘Sƒe[ƒuƒ‹\‘¢‚ðƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Éo—Í ‚·‚é‚É‚ÍAŽŸ‚̂悤‚É‚·‚éB(•\ˆê——Aƒe[ƒuƒ‹ˆê——) ®Ao—̓tƒ@ƒCƒ‹‚ÍAdnmAfnm ‚ŃpƒX‚ƃtƒ@ƒCƒ‹–¼‚ðŽw’è‚·‚éB ‚Ü‚½AƒJƒ“ƒ}‹æØ‚èo—Í‚É‚·‚é‚È‚ÇH•v‚·‚ê‚ÎACSV ƒtƒ@ƒCƒ‹Œ`Ž®‚Æ‚µ‚ÄA Excel ƒV[ƒg‚ɃRƒ“ƒo[ƒg‚·‚邱‚Æ‚à‰Â”\‚Å‚ ‚éB declare dnm varchar2(200) := 'g:\tmp'; -- ƒe[ƒuƒ‹\‘¢o—̓tƒ@ƒCƒ‹ƒpƒX fnm varchar2(200) := 'test.txt'; -- ƒe[ƒuƒ‹\‘¢o—̓tƒ@ƒCƒ‹–¼ cursor cu is select lower(table_name) as ƒe[ƒuƒ‹–¼, column_name as €–Ú–¼, lower(data_type) as €–Úƒ^ƒCƒv, nvl(data_precision, char_col_decl_length) as ’·‚³, data_scale as ¬”•” from user_tab_columns order by table_name, column_id; fno utl_file.file_type; rec varchar2(1000); svtbl varchar2(200) := ''; begin -- ƒe[ƒuƒ‹\‘¢ƒeƒLƒXƒgƒtƒ@ƒCƒ‹o—Í fno := utl_file.fopen(dnm, fnm, 'W'); for cu_rec in cu loop if svtbl is null or svtbl != cu_rec.ƒe[ƒuƒ‹–¼ then utl_file.put_line(fno, '========================================================================'); utl_file.put_line(fno, 'ƒe[ƒuƒ‹ - ' || cu_rec.ƒe[ƒuƒ‹–¼); utl_file.put_line(fno, '========================================================================'); utl_file.put_line(fno, '€–Ú–¼ ƒ^ƒCƒv ’·‚³ ¬”•”'); utl_file.put_line(fno, '------------------------------------------------------------------------'); svtbl := cu_rec.ƒe[ƒuƒ‹–¼; end if; utl_file.put_line( fno, rpad(cu_rec.€–Ú–¼, 37) || ' ' || rpad(cu_rec.€–Úƒ^ƒCƒv, 20) || ' ' || to_char(cu_rec.’·‚³, '99999') || ' ' || to_char(cu_rec.¬”•”, '99999') ); end loop; utl_file.put_line(fno, '========================================================================'); utl_file.fclose(fno); end; / -- ˆ—Œ‹‰Ê -- ======================================================================== ƒe[ƒuƒ‹ - ipm ======================================================================== €–Ú–¼ ƒ^ƒCƒv ’·‚³ ¬”•” ------------------------------------------------------------------------ IP varchar2 15 ‘gD1 varchar2 200 ‘gD2 varchar2 200 ======================================================================== ƒe[ƒuƒ‹ - ƒR[ƒhm ======================================================================== €–Ú–¼ ƒ^ƒCƒv ’·‚³ ¬”•” ------------------------------------------------------------------------ ƒL[ varchar2 20 ƒf[ƒ^ varchar2 200 XV’S“–ŽÒ varchar2 20 XV“ú•t char 10 XVŽžŠÔ char 8 ======================================================================== ƒe[ƒuƒ‹ - ƒeƒXƒgm ======================================================================== €–Ú–¼ ƒ^ƒCƒv ’·‚³ ¬”•” ------------------------------------------------------------------------ ƒL[ char 8 ƒf[ƒ^1 number 9 0 ƒf[ƒ^2 number 9 0 ƒf[ƒ^3 number 9 0 ======================================================================== ¡Oracle PL/SQL •ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿