[Python] SQLite 테이블 if not 으로 검색 후 생성, 삭제(drop, delete)


[Python] SQLite 테이블 if not 으로 검색 후 생성, 삭제(drop, delete)

목차 SQLite에 대한 기본적인 내용을 확인하고 싶으시면 블로그에 데이터베이스(Database)의 SQLite 카테고리에서 처음부터 확인하시면 됩니다. 파이썬 SQLite 테이블 검색 후 생성하기 SQLite 구문에서 if not exists 을 사용하면 해당 내용이 없을 경우 특정 명령을 실행하게 할 수 있습니다. 명령어 if not exists 찾는내용 아래 예제는 특정 테이블을 찾고 없을 경우 6개의 테이블을 새로 생성하는 예제 입니다. 예제 코드>> import sqlite3 from sqlite3 import Error def connection(): try: con = sqlite3.connect('test0.db') return con except Error: print(Error) def..


원문링크 : [Python] SQLite 테이블 if not 으로 검색 후 생성, 삭제(drop, delete)