I am working on a project that requires me to get data from a SAP HANA database. I utilized SAP Cloud Connector and PyHDB for the job. I execute my select statement and obtain the result data. One of the fields is a TEXT type, containing large articles. While iterating each row I need to somehow get the data from the TEXT field into a string. However I am only able to get the first 1024 characters. The object that stores the TEXT appears to be a StringIO type. How can I read the entire text data instead of the first 1024 characters only?
import pyhdb
connection_from = pyhdb.connect(
host="localhost",
port=00000,
user="user",
password="password"
)
cursor_from = connection_from.cursor()
cursor_from.execute('SELECT * FROM SCHEMA.TABLE')
results= cursor_from.fetchall()
for row in results:
text = row[2].data.getvalue()
connection_from.close()
This is the what the object looks like: NClob
I need to get the whole text into a string then print it. Thank you.