-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPopulate_Table.py
36 lines (24 loc) · 1023 Bytes
/
Populate_Table.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import oracledb
import time
# Replace these with your actual values
user = "SYS" # Your Oracle username
password = "mypassword1" # Your Oracle password
dsn = "localhost:1521/ORCLCDB" # DSN (e.g., "localhost:1521/orclpdb1")
# Establish the connection
connection = oracledb.connect(user=user, password=password, dsn=dsn, mode=oracledb.SYSDBA)
# Create a cursor and execute some queries
cursor = connection.cursor()
repeated_string = "abdeababababababababababababababababababababababfgrrrhq"
# SQL Insert statement
sql_insert = "INSERT INTO Q2 (Name) VALUES (:name)"
string1 = "abde"+"ab"*20+"fgrrrhq"
# string2 = "abde"+"ab"*20+"fgrrrhp"
# string3 = "abde"+"ab"*19+"afgrrrhq"
# string4 = "abda"+"ab"*19+"agrrrhq"
# Insert 'abc' 10 times using a for loop
for i in range(100000):
cursor.execute(sql_insert, {'name': string1})
# cursor.execute(sql_insert, {'name': string2})
# cursor.execute(sql_insert, {'name': string3})
# cursor.execute(sql_insert, {'name': string4})
connection.commit()