Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sqlite basic

import sqlite3
connect = sqlite3.connect('url-nb.db')
cur = connect.cursor()
cur.execute('drop table if exists url')
cur.execute('''create table url (id integer primary key,
                                url text,
                                title text)''')
for line in lines:
    cur.execute('insert into url (url) values (?)', (line.strip(),))
cur.execute('select url from url')
rows = cur.fetchall()
print(len(rows))
print(rows)
 
PREVIOUS NEXT
Tagged: #sqlite #basic
ADD COMMENT
Topic
Name
3+2 =