Skip to main content
Wrapper Class around ibm_db (IBM-DB2)

In IBM-DB2 after every read, the data needs to be fetched and after evey write, the data needs to be committed. But this class eliminates these requirements and make it simple to read and write to the database.

Files:

ibmdb2/__init__.py

Usage Examples:

import ibmdb2

db = ibmdb2.db(conn_str) ##-connect to the database using the connection string for example conn_str = “DATABASE=BLUDB; HOSTNAME=dashdb-txn-sbox-yp-dal09-04.services.dal.bluemix.net; PORT=50000; PROTOCOL=TCPIP; UID=username; PWD=password;”

Note: In the SQL statements all columns should be enclosed with “ double quotes and text be enclosed with ‘ single quotes.

db.read(‘select “column1”,”column2” from mytable where “column1” like 'myword' ‘) ##-returns column1 & 2 from table where column = myword

db.read(‘select “column” from table”, flat=False) ##-returns the raw read data

db.read(f’select “item” from table where “item” = '{Variable}'’) ##-read with string substitution

db.read1(‘sql statement’) ##-returns the first read data similar to fetchone

db.write(‘sql statement’) ##-writes the data and commits to the database

For other connection commands use the connection class

db.conn….

Metadata

Release files for ibmdb2 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibmdb2 0.3
File Size Uploaded
ibmdb2-0.3.tar.gz 1.8 kB Details

Release files / ibmdb2-0.3.tar.gz

Download URL ibmdb2-0.3.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d168fd9cf53bd87476d5f79ef52db01be6f41da32a61d461baf10d79490c650a
BLAKE2b-256 checksum
How to use checksums
a8130fefb91e2d1f32ef6f50d8074c2e2ac9869a2eaecf62ecc138c8f9d52946
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page