I have installed teradata python module with python 3.5.1 version. I'm calling a teradata SP that return CLOB and some VARCHAR parameters. The SP in out parameters are shown below,
IN iProcess_Name VARCHAR(30)
,IN iDebug_Level BYTEINT
,IN iProcess_Type BYTEINT
,IN iProcess_State BYTEINT
,IN iTD_Server VARCHAR(30)
,IN iTD_User_Name VARCHAR(30)
,IN iPassword_String VARCHAR(30)
,OUT oReturn_Code SMALLINT
,OUT oReturn_Message VARCHAR(255)
,OUT oReturn_Script CLOB(1000000000) -- used for returning generated TPT script
,OUT oReturn_Parameters VARCHAR(4000)
,OUT oReturn_LogonText VARCHAR(1000)
Now only issue i'm getting is the oReturn_Script CLOB data type contents got truncated and only 117 lines of TPT script are returned in Python result variable. But when i call the same SP from SQLA i get complete script (181 lines of total length)
Below is python call SP
results = session.callproc("GDEV1P_FF.GCFR_FF_TPTLoadCLOB_Generate",("LD_668_66_Customer",6,17,0,"localhost","dbc","dbc",teradata.OutParam("oCode"),teradata.OutParam("oMessage"),teradata.OutParam("oScript"),teradata.OutParam("oParams"),teradata.OutParam("oLogon")))
when i print(results.oScript) or write it in a file the oScript contents were truncated. As per Teradata Python module page says the VARCHAR, CLOB, UDT, ARRAY, etc. data types are returned as Python UNICODE String.
How can i get the complete contents? Please help!
the Python log for above python code execution.
The OutParam object takes a size argument, which is the size of the buffer to allocate to receive the value of the output parameter. Try setting this value to a value greater than or equal to the size of the script being returned.