Skip to main content
Oct 23, 2018 12:46 PM UTC

Adding SQLite to your Tools

SQLite would be a great addition to your Open Source Tools. The current version (3.25.2) should compile without any changes and it would be a great back-end DB when a full blown Database is overkill.

    2 replies

    Oct 24, 2018 7:15 AM UTC

    SQLite would be a great addition to your Open Source Tools. The current version (3.25.2) should compile without any changes and it would be a great back-end DB when a full blown Database is overkill.

    SQLite is included in Python.

    It works like this:
    (131) python
    Python 3.6.1 (default, Apr 7 2017, 13:59:34) [C] on zos
    >>> import sqlite3
    >>> conn=sqlite3.connect(‘my.db’)
    >>> c = conn.cursor()
    >>> c.execute(’’‘CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)’’’)
    <sqlite3.Cursor object at 0x5008C78F10>
    >>> c.execute(“INSERT INTO stocks VALUES (‘2006-01-05’,‘BUY’,‘RHAT’,100,35.14)”)
    <sqlite3.Cursor object at 0x5008C78F10>
    >>> conn.commit()
    >>> c.execute(“SELECT * FROM stocks WHERE symbol = ‘RHAT’”)
    <sqlite3.Cursor object at 0x5008C78F10>
    >>> print(c.fetchone())
    (‘2006-01-05’, ‘BUY’, ‘RHAT’, 100.0, 35.14)
    >>> conn.close()
    >>> exit()

    Oct 24, 2018 8:35 AM UTC

    SQLite would be a great addition to your Open Source Tools. The current version (3.25.2) should compile without any changes and it would be a great back-end DB when a full blown Database is overkill.

    As a stand alone product I could us in REXX Programs (or COBOL, or PL/I).