RUVIDEO
Поделитесь видео 🙏

Python programming | Insert data into database table using python

Video topics:
00:00 - Intro
00:15 - Code Glance (import libraries, create connection, create cursor, execute sql)
00:33 - try-catch-except
03:45 - Insert statement
05:20 - executing the code



This is the third video of Database programming with Python. In this video, we will see how to connect to the Oracle database using the cx_oracle package and insert a record into the table using the execute method. The table has been created in the second video of the tutorial series.

execute method takes in the SQL statement that you want to execute, and optionally you can send the list of data that will replace the bind variables in the SQL statement or a dictionary with the appropriate bind variables names.

Steps performed:
================
Create Connection
Create Cursor
Prepare insert into statement
Execute Statement with execute()
commit/rollback the connection
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
=================================================================
1. Install cx_Oracle : https://youtu.be/NZ28xlUUEoA
2. Create connection and create table : https://youtu.be/6OwZvANOZaE
3. Insert record into the table with execute() : https://youtu.be/W0Ny-N0sOEg
4. Insert multiple records into the table with executemany() : https://youtu.be/HmKjbFnOaUU
5. Retrive all the data from the table using the fetchall() : https://youtu.be/dTxS3e2OkDc
6. Retrive one record from the table using the fetchone() : https://youtu.be/VCHoIZi7hew
7. Retrive specific number of records from the table using the fetchmany() : https://youtu.be/zePkstJ-O5U
8. Use Bind Variables in the select statement to avoid complicating the query with concatenation operation : https://youtu.be/L_tEpakjv8U
9. use callproc method to execute oracle procedure with parameters : https://youtu.be/kcy1U7TIee4
10. use callfunc method to execute oracle function with parameters : https://youtu.be/ghx9gOFnibQ


Tools used in creating and executing the scripts:
==================================================
VSCode - Visual Studio Code
SQL Developer

Links used while creating the content:
=======================================
https://en.wikipedia.org/wiki/Pip_(package_manager)

https://oracle.github.io/python-cx_Oracle/

https://github.com/oracle/python-cx_Oracle/tree/master/samples


Content and video created by - Kishan Mashru

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python programming | Insert data into database table using python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.