SQL*Plusããåãåãããè¡ã£ãçµæããã¡ã¤ã«ã«åºåãããããªãã¦ãã¨ã¯çµæ§ããã¨æãã¾ãã
æ®æ®µä½¿ããªãã¨å¿ããã¡ãªã®ã§ãSQL*Plusã®åãåããçµæããã¡ã¤ã«ã¸åºåããæ¹æ³ãã¾ã¨ãã¦ããã¾ãã
spoolã³ãã³ãã«ãããã¡ã¤ã«åºå
SQL*Plusãããã¡ã¤ã«ã¸åºåããæ¹æ³ã¯ã¨ã¦ãç°¡åã§ãspoolã³ãã³ããå©ç¨ãã¾ããã³ãã³ãå½¢å¼(ç´°ããªãªãã·ã§ã³çã¯çç¥)
spool ãã¡ã¤ã«å
select * from ~
spool off
å ·ä½çã«ã¯ä¾ã¯ãããªæãã
SQL> spool C:\test.txt SQL> select * from SPOOL_TEST; ID NAME âââââ ââââââââââââââââââââ 1 item1 2 item2 3 item3 SQL> spool off
åºåãã¡ã¤ã«ã®æå®ã¨æ¸ãè¾¼ã¿ã®éå§
SQL> spool C:\test.txt
ã§æå®ãããã¡ã¤ã«ã¸ã®æ¸ãè¾¼ã¿ãéå§ãã¾ãã
ãã ããspolã³ãã³ãã¯selectã®åãåããçµæãæ¸ãè¾¼ãã®ã§ã¯ãªãSQL*Plusã®ã³ãã³ãã©ã¤ã³ä¸ã®åºåãå ¨ã¦æ¸ãè¾¼ããã注æãå¿ è¦ã§ãã
æ¸ãè¾¼ã¿ã®çµäº
spool off
ã§æ¸ãè¾¼ã¿ãçµäºãã¾ãã
åºæ¬çã«ã¯ããã§æ¸ãè¾¼ã¿ãã§ãã¾ãã
ãã¡ã¤ã«åºåæã®åé¡ã¨è§£æ±ºç
次ã«å¿ç¨ãã¨ãããããããããããã®ãªãã·ã§ã³ãè¦ããªãã¨ä½¿ããå½¢ã§åºåã§ããªãï¼ç¬ï¼æ¹è¡ããããåé¡
ä¾ãã°åãåããçµæãé ç®åãé·ãããã¨....SQL> select * from spool_test2; ID NAME âââââ ââââââââââââââââââââ NOTES âââââââââââââââââââââââââââââââââââââââ UP_DATE ââââ 1 item1 This is Item No.1 10-12-05 SQL>
åºåçµæããã®éãæ¹è¡ããã¦ãã¨ã¦ãè¦ã¥ããã
ãªããããªãã¨ã«ãªãã®ãã¨ããã¨ã1è¡ãããã®åºåãã¤ãæ°ãSQL*Plusã®ããã©ã«ãã§å°ããªå¤ã«ãªã£ã¦ãããããï¼ãã®ä»ã³ãã³ãã©ã¤ã³çã®åºåãããã¡ãµã¤ãºãå½±é¿ãã¾ãï¼
1è¡ãããã®åºåæ¡æ°ãå¤æ´ããã«ã¯set linesizeã³ãã³ããå©ç¨ãã¾ãã
set linesize 1è¡ãããã®è¡¨ç¤ºãã¤ãæ°
ããã©ã«ãã¯80ã§ï¼æå®ã§ãããã¤ãæ°ã®ä¸éã¯ã·ã¹ãã (OS)ä¾åã®ããã§ãã
set linesizeãå®è¡ãããã¨ã§ãæå®ãããã¤ãæ°åã1è¡ã«åºåã§ããããã«ãªãã¾ãã
SQL> set linesize 1000; SQL> select * from spool_test2; ID NAME NOTES âââââ ââââââââââââââââââââ âââââââââ.... 1 item1 This is Item No.1 .... SQL>
1è¡é·ããåé¡
ï¼è¡ãç¡é§ã«é·ãæãè¿ãã¦ãã¾ãå ´åã¯columnã³ãã³ããå©ç¨ãã¾ããcolumn ã«ã©ã å FORMAT 'ãã©ã¼ãããæåå'
ã«ã©ã åã«ã¯ãã©ã¼ããããè¨å®ããååããã©ã¼ãããã«ã¯åºåå½¢å¼ãæå®ãã¾ãã
SQL> column id FORMAT '09'; SQL> column NAME FORMAT 'a10'; SQL> column NOTES FORMAT 'a30'; SQL> SELECT * FROM spool_test2; ID NAME NOTES UPDATE_AT âââââ ââââââââââââââââââââ âââââââââââââââââ ââââââââââââ 1 item1 This is Item No.1 10-12-05 SQL>
ã09ãã¯æ°å¤åã«å¯¾ããæ¸å¼ã§ã2æ¡ã®å¤ã«ãããã¨ãæå³ãã¦ãã¾ãã
ãa10ãã¯æååã«å¯¾ããæ¸å¼ã§ããã®å ´åã¯10ãã¤ãã®æååãæå³ãã¦ãã¾ãã
ããã§1è¡ã®è¡¨ç¤ºæ¡æ°ãã³ã³ããã¼ã«ã§ãã¾ãã
è¦åºããä½åº¦ãåºãåé¡
åºåãããã¼ã¿ä»¶æ°ãå¤ãå ´åã«ãè¦åºããä½åº¦ãåºã¦ãã¾ããããã¯1ãã¼ã¸å½ããã®åºåè¡æ°ãå¤æ´ãããã¨ã§å¯¾å¦å¯è½ã§ããset pagesizeã³ãã³ãã使ãã¾ãã
set pagesize 1ãã¼ã¸å½ããã®åºåè¡æ°
1ãã¼ã¸ãããã®åºåè¡æ°ã0ã«ããã¨ï¼åè¦åºããç¡ããªãã¾ãã
以ä¸ãSQL*Plusã®åºåã«ã¤ãã¦è«¸ã ãã¾ã¨ãã¦ã¿ã¾ããï¼
SQLå®è·µå ¥éââé«éã§ããããããã¯ã¨ãªã®æ¸ãæ¹ (WEB+DB PRESS plus)
- ä½è : ããã¯
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2015/04/11
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã° (7件) ãè¦ã
SQL ã¼ãããã¯ããããã¼ã¿ãã¼ã¹æä½
- ä½è : ããã¯
- åºç社/ã¡ã¼ã«ã¼: ç¿æ³³ç¤¾
- çºå£²æ¥: 2013/08/28
- ã¡ãã£ã¢: Kindleç
- ãã®ååãå«ãããã° (4件) ãè¦ã