29 åæ£ãã¼ã¿ãã¼ã¹ã®æ¦å¿µ ãã®ç« ã§ã¯ãOracle Databaseã®åæ£ãã¼ã¿ãã¼ã¹ã»ã¢ã¼ããã¯ãã£ã®åºæ¬çãªæ¦å¿µã¨ç¨èªã«ã¤ãã¦èª¬æãã¾ãã ãã®ç« ã®å 容ã¯ã次ã®ã¨ããã§ãã åæ£ãã¼ã¿ãã¼ã¹ã»ã¢ã¼ããã¯ã㣠ãã¼ã¿ãã¼ã¹ã»ãªã³ã¯ åæ£ãã¼ã¿ãã¼ã¹ã®ç®¡ç åæ£ã·ã¹ãã ã§ã®ãã©ã³ã¶ã¯ã·ã§ã³å¦ç åæ£ãã¼ã¿ãã¼ã¹ã»ã¢ããªã±ã¼ã·ã§ã³ã®éçº åæ£ç°å¢ã§ã®ãã£ã©ã¯ã¿ã»ã»ããã®ãµãã¼ã åæ£ãã¼ã¿ãã¼ã¹ã»ã¢ã¼ããã¯ã㣠åæ£ãã¼ã¿ãã¼ã¹ã»ã·ã¹ãã ã使ç¨ããã¨ãã¢ããªã±ã¼ã·ã§ã³ã¯ãã¼ã«ã«ã»ãã¼ã¿ãã¼ã¹ããã³ãªã¢ã¼ãã»ãã¼ã¿ãã¼ã¹ã®ãã¼ã¿ã«ã¢ã¯ã»ã¹ã§ãã¾ããåæ©ç¨®éåæ£ãã¼ã¿ãã¼ã¹ã»ã·ã¹ãã ã§ã¯ãåã ã®ãã¼ã¿ãã¼ã¹ã¯Oracle Databaseã§ããç°æ©ç¨®éåæ£ãã¼ã¿ãã¼ã¹ã»ã·ã¹ãã ã§ã¯ãå°ãªãã¨ããã¼ã¿ãã¼ã¹ã®1ã¤ãOracle Database以å¤ã®ãã¼ã¿ãã¼ã¹ã§ããåæ£ãã¼ã¿ãã¼ã¹ã¯ãã¯ã©ã¤
â表ã®ä¸è¦§ SQL# select * from tab; â表ã®é ç®ä¸è¦§ SQL# desc 表å;ï¼;ã¯çç¥å¯ï¼ âã¤ã³ããã¯ã¹ã®ä¸è¦§ SQL# select * from user_ind_columns; â»æå®ãã表ã®ã¤ã³ããã¯ã¹ã®ã¿ã表示ãããã¨ãã§ãã¾ãã SQL# select column_name from user_ind_columns where table_name = '表å'; âã¦ã¼ã¶ä¸è¦§ SQL# select username from user_users; âãã¼ã¿ãã¼ã¹ã®æåã³ã¼ã SQL# select * from NLS_DATABASE_PARAMETERS where PARAMETER = 'NLS_NCHAR_CHARACTERSET'; 表ã®ã³ãã¼æ¹æ³ create tableã³ãã³ãã§è¡¨ã®ã³ãã¼ãã§ãã¾ãã ãã ããå¶ç´æ¡ä»¶ã¯ã
ããã«ã¡ã¯ã ãã¤ããä¸è©±ã«ãªã£ã¦ãã¾ãã updateæã使ç¨ãã¦ããã¼ã¿ã«æ¹è¡ãå ¥ãããã®ã§ãããã©ãããã°ããã§ããããã 対象åã®ãã¼ã¿åã¯VARCHAR2ã§ãã ä¾ãã°SQLPLUSããã SPL>update ããã¼ãã«åãset ã対象åã='ãæ¹è¡ãæ¹è¡ãæ¹è¡' ãæå ¥ãããã®ã㨠select ã対象åã from ããã¼ãã«åã ã¨ãã㨠SQL>ã SQL>ã SQL>ã ã¨åºã¦ããã°ãããã§ããã SQL>update ããã¼ãã«åãset ã対象åã='ã\nã\nã\n' ã¨ãã¦ã SQL>ã\nã\nã\n ã¨ãã\nããæååã¨ãã¦ã§ã¦ãã¦ãã¾ãã¾ãã SPL>update ããã¼ãã«åãset ã対象åã='ã 2ã 3ã' ã¨æå ¥ããã¨ãæå¾ éãã«ãªãã®ã§ããã ããã§ã¯ãªãä¸è¡ã«ã¾ã¨ãããã®ã§ããã©ãããã°è¯ãã§ããããã Oracle9iã使ç¨ãã¦ã
ãªãã©ã«ï¼ã³ã³ã¹ã¿ã³ãå¤ï¼ ãªãã©ã«ã¨ã¯å®æ°å¤ã§ãããã³ã³ã¹ã¿ã³ãã¨ãå¼ã°ãããã¨ãããã ããããæ£ç¢ºã«ã¯ãªãã©ã«ã¯ã³ã³ã¹ã¿ã³ãå¤(constant value)ãããããã ãªãã©ã«å¤ NULL ã¨ãã表ç¾ã¯ãã³ã³ã¹ã¿ã³ãå¤ã®å¤ NULL ã«ãªã£ã¦ãã¾ãã¾ãã®ã§ãç´åç©ãªã©ã«ã¯æ³¨æãå¿ è¦ã§ãã â æ¥æã»æ¥ä»ã»æé ãªãã©ã« æåãªãã©ã« æåãªãã©ã«ã§ã¯ãåä¸å¼ç¨ç¬¦(') ã§å²ãå¿ è¦ããããâ» äºéå¼ç¨ç¬¦(")ã§å²ã¾ãããã®ã¯ãªãã¸ã§ã¯ãåã¨ãã¦åãæ±ãããã®ã§ä½¿ç¨ãããã¨ã¯ã§ããªãã æåãªãã©ã«ã«éã£ããã¨ã§ã¯ãªãããæ大é·ã¯ 4000 æåã§ããã 4000 æåãè¶ ãã㨠ORA-01704: æååãªãã©ã«ãé·ããã¾ã ã¨ã©ã¼ãçºçããã ãã¼ã¿ãã¼ã¹ãã£ã©ã¯ã¿ã»ããã®æåãªãã©ã« æåå Abc ããããããã123 'Abc' 'ããããã' '123' åå½èªãã£ã©ã¯
Oracle è±è¾å ¸ 注æ ï¼ ããã¯ãç§å人ã®è¦ãæ¸ãã§ãããä½ãä¿è¨¼ãããã§ã¯ããã¾ãããèªå·±è²¬ä»»ã§ãèªã¿ä¸ããã èªåå°ç¨ã®ã¦ã¼ã¶æ¨©é ããã©ã«ãã§ä½æããã¦ããã¦ã¼ã¶ ãªããã£ãã¤ã¶ã«ãã³ããä¸ããã«ã¯ çµ±è¨æ å ±ã®åãæ¹ ã¨ã©ã¼ã¡ãã»ã¼ã¸ã³ã¼ãâ00000â ãã»ãã®ã¦ã¼ã¶ã¼ãåããã¼ã¿ã«å¯¾ãã¦ã»ã»ã»ãã®ã¡ãã»ã¼ã¸ Version ã®åå¾ åæåãã©ã¡ã¼ã¿ã®åå¾ ï¼³ï¼§ï¼¡é ååå¾ ç»é²ããã¦ããã¦ã¼ã¶ã表示ãã ãã¼ãã«ã¹ãã¼ã¹ã®ç·å®¹éã使ç¨å®¹éã空ã容éåå¾ ãã¼ãã«ã¹ãã¼ã¹ã®ç¶æ³ç¢ºèª ãã¼ãã«ã¹ãã¼ã¹ã«æ ¼ç´ããã¦ãããªãã¸ã§ã¯ãåå¾ ãã¼ãã«ã¹ãã¼ã¹å ã®ç©ºãé å ãã¼ãã«ã¹ãã¼ã¹å ã®ç©ºãé åãçµåãã ã©ã¤ãã©ãªãã£ãã·ã¥ãè¦æ±æ°ãåèªè¾¼æ°ããããç ãã¼ã¿ã»ãã£ã¯ã·ã§ããªã»ãã£ãã·ã¥ãè¦æ±æ°ãåèªè¾¼æ° ãã¼ã¿ãã¼ã¹ã»ãããã¡ï½¥ãããç å ±æãã¼ã«å ã®ç©ºãé åã®å¤§ããåå¾ ã¡ã¢ãª
Oracleã«ã¯ãCSVãã¡ã¤ã«ãèªã¿è¾¼ãSQL*Loaderã¨ããã¦ã¼ãã£ãªãã£ã¯åå¨ãããã ãã®éã®CSVãã¡ã¤ã«ãæ¸ãåºãã¦ã¼ãã£ãªãã£ã¯åå¨ããªãã SQL*Plusã使ç¨ãã¦CSVãã¡ã¤ã«ãä½æããä¾ã以ä¸ã«ç¤ºãã Oracleã®Scottã¦ã¼ã¶ã®emp表ãä¾ã«ããã emp表ã¯ä»¥ä¸ã®ããã«å®ç¾©ããã¦ããã SQL> desc emp åå NULL? ã¿ã¤ã ------------------------------- -------- ---- EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10 JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2) CSVãã¡ã¤ã«ãä½æããçºã«ä»¥ä¸ãå®è¡ããã SQL> s
2003å¹´7æ11æ¥ã«è¡ã£ãåæ§ã®ã¿ã¤ãã«ã®iSeminarãæ¯è¼ç好è©ã ã£ããã¨ãããéæã§å ¨3åäºå®ã®iSeminarã®å 容ããå¹³è¡ãã¦OTNã§ã¯æ¯æå ¨6åã®å½¢ã§é£è¼ãã¾ãã ç§ã¯æ®æ®µã¯OracleDirectã«ãç¸è«ããã ããã客æ§ã®ãåè«æç´ã®ããã®æè¡çãªæ¯æ´ãæ å½ãã¦ããã¾ããOracle製åã®è³¼å ¥ããæ¤è¨ãããéã¯ãæ¯éOracleDirectã«ãç¸è«ãã ããã ãããã¯ãµã¤ãºã決ããåºæ¬çãªæé ãããã¯ãµã¤ãºã¯CREATE DATABASEã³ãã³ãå®è¡æã«åæåãã©ã¡ã¼ã¿DB_BLOCK_SIZEã«è¨å®ãã¾ããåºæ¬çã«ã¯2,048ã»4,096ã»8,192ã»16,384ã»32,768ãã¤ãã®ããããããé¸æãããã¨ã«ãªãã¾ãããã ã32,768ãã¤ãã¯64bitç³»ã®ä¸é¨ã®OSçã®Oracleã®ã¿ã§æå®ã§ãã¾ããããã©ã«ãã¯OSã«ãããã¾ããã»ã¨ãã©ã®å ´å2,048byteã§
é åºã®çæ SQL> CREATE SEQUENCE TS_ä¼ç¥¨çªå·; é åºãä½æããã¾ããã ããã«ããé åºåã"TS_ä¼ç¥¨çªå·"ã§å ¨ã¦ã®ãã©ã¡ã¼ã¿ã¯ããã©ã«ãå¤ã§çæããã¾ããã å®éã«é åºã®ãã©ã¡ã¼ã¿ããã®æ§ã«è¨å®ããããã¯ãUSER_SEQUENCESãã¼ã¿ãã£ã¯ã·ã§ããªãã¥ã¼ãæ¤ç´¢ããã¨æ§åããããã¾ãã SQL> SELECT * FROM USER_SEQUENCES WHERE SEQUENCE_NAME = 'TS_ä¼ç¥¨çªå·'; SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER ------------------------------ ---------- ---------- ------------ - - ---------- ----------- TS_ä¼ç¥¨çªå·
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}