Forum Discussion
Mr_Bro
Champion Level 0
Please find the below python script to retrieve the data from database and log the count the record set.
import sys
sys.path.insert(0,r'c:\users\skuma37\appdata\roaming\python\python38\site-packages')
import mysql.connector
def SampleDBCheck():
connection = mysql.connector.connect(
host="HOSTNAME",
database='DATABASENAME',
user="USERNAME",
password="PASSWORD"
)
sql_select_Query = "select * from SampleTable where id < 10"
cursor = connection.cursor()
cursor.execute(sql_select_Query)
records = cursor.fetchall()
Log.Message("Total number of rows in table: "+ str(cursor.rowcount))
rohini11
4 years agoNew Contributor
Hi Satish,
Thanks for the reply.
I'm beginner in coding and trying to work with Java script.
Related Content
Recent Discussions
- 4 hours agotramuntana
- 2 days agoSlickRick