filmov
tv
Python programming | Select or get data from table using python | Extract data from table | Part - 2

Показать описание
This is the sixth video of Database programming with Python video tutorial series. In this video, we will see how to connect to the Oracle database using the cx_oracle package and fetch one record or data at a time from the table using the fetchone method. The table has been created in the second video of the tutorial series.
fetchone() will return a single record that will be available with the cursor, basically, all the data that the select statement would have fetched will be stored with the cursor, and you can use the fetchone method to one by one get all the data. If no data is available in the cursor and fetchone() is executed, it will return None, meaning no more data is available with the cursor.
fetchone method returns a tuple, each row will be available as a tuple, upon execution.
Steps performed:
================
Create Connection
Create Cursor
Prepare select statement
Execute select statement with execute()
Fetch first record using the fetchone()
Fetch next record using the fetchone()
close the cursor
close the connection
The cx_Oracle is a Python extension module that enables access to Oracle Database. It conforms to the Python database API 2.0 specification with a considerable number of additions and a couple of exclusions.
cx_Oracle 7 has been tested with Python version 2.7, and with versions 3.5 through 3.8. You can use cx_Oracle with Oracle 11.2, 12, 18 and 19 client libraries. Oracle's standard client-server version interoperability allows connection to both older and newer databases. For example, Oracle 19c client libraries can connect to Oracle Database 11.2.
Links to all videos related to Database programming with Python
=================================================================
Tools used in creating and executing the scripts:
==================================================
VSCode - Visual Studio Code
SQL Developer
Links used while creating the content:
=======================================
Other Playlists:
Content and video created by : Kishan Mashru
fetchone() will return a single record that will be available with the cursor, basically, all the data that the select statement would have fetched will be stored with the cursor, and you can use the fetchone method to one by one get all the data. If no data is available in the cursor and fetchone() is executed, it will return None, meaning no more data is available with the cursor.
fetchone method returns a tuple, each row will be available as a tuple, upon execution.
Steps performed:
================
Create Connection
Create Cursor
Prepare select statement
Execute select statement with execute()
Fetch first record using the fetchone()
Fetch next record using the fetchone()
close the cursor
close the connection
The cx_Oracle is a Python extension module that enables access to Oracle Database. It conforms to the Python database API 2.0 specification with a considerable number of additions and a couple of exclusions.
cx_Oracle 7 has been tested with Python version 2.7, and with versions 3.5 through 3.8. You can use cx_Oracle with Oracle 11.2, 12, 18 and 19 client libraries. Oracle's standard client-server version interoperability allows connection to both older and newer databases. For example, Oracle 19c client libraries can connect to Oracle Database 11.2.
Links to all videos related to Database programming with Python
=================================================================
Tools used in creating and executing the scripts:
==================================================
VSCode - Visual Studio Code
SQL Developer
Links used while creating the content:
=======================================
Other Playlists:
Content and video created by : Kishan Mashru
Комментарии