Python ÇÁ·Î±×·¡¹Ö > Sqlite3 - ´Ù¾çÇÑ Äõ¸® ¿¹Á¦µé µî·ÏÀÏ : 2017-08-04 14:01 Á¶È¸¼ö : 53,0341. Å×À̺íÀÇ Çʵå¸í ±¸Çϱâ ( cursor.description )
Å×À̺íÀÇ Çʵå¸íÀ» ±¸Çϱâ À§Çؼ´Â cursor.description À» »ç¿ëÇÏ¸é µÈ´Ù.
°á°ú --------------------------- Name price Çʵå¸í, Name, price Çʵå¸íÀÌ Ãâ·ÂµÇ´Â°É È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù. 2. DB ³»ÀÇ Å×ÀÌºí ¸ñ·ÏÀ» ±¸ÇÏÀÚ select name from sqlite_master where type='table'
¿¹Á¦¸¦ È®ÀÎÇØ º¸±â ¹Ù¶ø´Ï´Ù.3. DB ³»¿¡ ƯÁ¤ Å×À̺íÀÌ Á¸ÀçÇÏ´ÂÁö ¾Ë¾Æº¸ÀÚ. select name from sqlite_master where type='table' and name='Å×À̺í¸í'
°á°ú: Å×À̺íÀÌ Á¸ÀçÇϸé: [('Å×À̺í¸í',)] Á¸ÀçÇÏÁö ¾ÊÀ¸¸é : [] 4. Å×ÀÌºí³»ÀÇ Çʵå(column) Type ¾Ë¾Æ³»±â PRAGMA table_info(Å×À̺í¸í)
°á°ú : (0, 'Name', 'text', 0, None, 0)(1, 'price', 'int', 0, None, 0) °á°ú
|