Open-source Languages & Tools for z/OS

 View Only
  • 1.  Adding SQLite to your Tools

    Posted 10-23-2018 12:46

    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.  RE: Adding SQLite to your Tools

    Posted 10-24-2018 07:15

    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()



  • 3.  RE: Adding SQLite to your Tools

    Posted 10-24-2018 08:35

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