ä»ã¾ã§è¦ããã£ã¨ãã¯ã½ãªãã¼ãã«è¨è¨
ããã¯ãåããã¼ã¿ãã¼ã¹ãæ±ããã¡æåããï¼ä»¶ç®ã®ããã¸ã§ã¯ãã ã£ãã
C++ã®ã½ã¼ã¹ãé£è§£ã§ç«ãå¹ãã¦ããã¨ãã話ã§ãèªåã¯ä½ã¹ãã«ã®è¥é ãç«ã«ãã¹ãã«ã¯ä¸åº¦è¯ãç¨åº¦ã®ããæ°ã¨è²¬ä»»æããã£ã¦ãããææªãå¥ã®ããã¸ã§ã¯ããçµäºããç´å¾ã ã£ããã®ã§æå ¥ãããã®ã§ããã
ç¾å ´ã§ãDBãããã¼ã¿ãå¸ãåºããã¼ã«ãSQLãä½ã£ã¦ãããã¨ããã話ãããã¨ä»ç¤¾ãä½ã£ãDBå®ç¾©ãããã¶ã使ãã¥ããã¨ããã
ERå³ãDBå®ç¾©ãè¦ãã¦ãã ããã¨è¨ã£ãã®ã ãã©ããããªãã®ã¯ç¡ãã¨ããè¿äºã
ä»ãªãããããã辺ã§éãåºãã¨ããã§ãããå½æã¯ããµã¼ãããã¦ãªããã§ãããããã¨ãããã®ããããã®è»½ãæ°æã¡ã§èãã¦ãã¾ããã
ã§ãããã¸ã§ã¯ãã®è³æããããã¾ãã£ã¦ä½ã¨ãDBå®ç¾©ã®ãããªãã®ãè¦ã¤ãDBã®ãã¼ã¿ã調æ»ãå§ããã®ã§ããä½ããããããã
æ©è½ã®æ°ã«æ¯ãã¦ç°æ§ã«ãã¼ãã«æ°ãå°ãªãã®ã§ãã
ãµã¨å¨ããè¦ãã¨ãç1ãã200ã¾ã§ãããã®æ°åã¨æåã®ãè¤æ°å並ã¶å¯¾å¿è¡¨ã®ãããªãã®ãè¦ãªããä½æ¥ããã¦ãã¾ãã
âExcelãããªã³ãã¢ã¦ããããããªãã¤ï¼ããã¯ã¤ã¡ã¼ã¸ã§ããï¼
種å¥ã³ã¼ã | å®ç¾© | ãã¼ã¿å |
---|---|---|
1 | XXXç¨®å¥ | æ°å¤ |
2 | ZZãã¼ã¿ | 10ã±ã¿ |
3 | ZZãã¼ã¿åä¿¡æ¥ä»ï¼å¹´ï¼ | yyyy |
4 | ZZãã¼ã¿åä¿¡æ¥ä»ï¼æï¼ | mm |
5 | ZZãã¼ã¿åä¿¡æ¥ä»ï¼æ¥ï¼ | dd |
6 | ZZãã¼ã¿åä¿¡æ¥ä»ï¼æï¼ | hh |
7 | ZZãã¼ã¿åä¿¡æ¥ä»ï¼åï¼ | mm |
8 | ZZãã¼ã¿åä¿¡æ¥ä»ï¼ç§ï¼ | ss |
ãªãã ãDBå®ç¾©ãããããã
ã¨ãæã£ãã®ãã¤ãã®éãããã¯DBå®ç¾©ã§ã¯ãªãããã§ãã
âå®éã®DBå®ç¾©ã¯ãããªã®ã§ããã
*1
åå | ãã¼ã¿å |
---|---|
ID | VARCHAR2(15) |
TYPE_CODE | NUMBER(10) |
DATA | VARCHAR2(2000) |
ã·ã³ãã«ããã¦ããããããã¾ããããã®ãã¼ãã«ã«å¯¾ãã¦Excelã®å¯¾å¿è¡¨ãã¿ãªããçãããªãããããè¦ã¦ããã®ã§ãã
å®ã¯ããã®ãã¼ãã«ã«ã¯ããã¨ãããããã¼ã¿ãæ¾ãè¾¼ã¾ããã©ã®ãããªãã¼ã¿ããã¤ã¾ããã¼ã¿ã®æå³ã¯TYPE_CODEã§å¤æããã¨ãã代ç©ã§ããã
ãªã«ããææªã ã£ãã®ã¯ãããæç¹ã®ãã¼ã¿ãåå¾ãããã¨æãã¨*2å¹´ææ¥æåç§ããã©ãã©ã®ãã¼ã¿ã§å
¥ã£ã¦ããã®ã§è¶
絶æ±ãã¥ããã¨ããã¨ããã§ããã
ã¾ããæ®éãªãä¸è¡ã§æ¸ããã¼ã¿ãinsertããéã«ãæ°è¡ã²ã©ãã¨ãã«ã¯åæ°è¡insertãå¿
è¦ã§ããã¼ã¿éãå端ãªãç¶æ
ã§ããã©ã¼ãã³ã¹ã¯åæªã§ãããã¨ãããã人ãæ··æ²ã«é¥ãã¦ããå
å¶ã ã£ãã®ã§ãã
ãªãã§ããããªãã¨ã«ãªã£ã¦ãããã ããï¼
ã©ãããããã°ã©ã ä¸DBã«åãã«è¡ãå¦çãçµ±ä¸ã§ããããã£ã½ãã¨ãã話ã§ããã*3
ãã®ä»¶ã§ç§ãå¦ç¿ããã®ã¯ããã°ã©ã ä¸ã®æ½è±¡åã¯æç¨ã ããDBè¨è¨ä¸ã®æ½è±¡åã¯ãã®ãããªãã¡ãªãããããããã®ã ã¨ãããã¨ã§ããã