You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a need to pass a 'NULL' parameter to my stored procedure, called from python code. The Python native null object , named 'None' doesn't seem to be recognized by the Teradata Python module.
code snippet:
vjobid = raw_input("Job ID : ")
vjobnm = raw_input("Job Name : ")
vstarttm = raw_input("Enter Start Time : ")
vnull = None
udaexec = teradata.UdaExec ()
with udaexec.connect("MYTD") as session:
results = session.callproc("MYDB.MYPROC",
(teradata.OutParam("resultcode1"),
teradata.OutParam("resultstate1"),
teradata.OutParam("resultmsg1"),
teradata.InOutParam(vnull,"inout_schid"),
vjobid,vjobnm,1,vstarttm,"N","N"))
print(results.resultcode1)
print(results.resultstate1)
print(results.resultmsg1)
Got error in log, as follows
AttributeError: 'NoneType' object has no attribute 'raw'
The text was updated successfully, but these errors were encountered:
Reopening issue as even though the error described above is resolved, when None is passed as an INOUT parameter to stored procedure the value is passed to the SP as 0 or an empty string and not NULL.
I have a need to pass a 'NULL' parameter to my stored procedure, called from python code. The Python native null object , named 'None' doesn't seem to be recognized by the Teradata Python module.
code snippet:
vjobid = raw_input("Job ID : ")
vjobnm = raw_input("Job Name : ")
vstarttm = raw_input("Enter Start Time : ")
vnull = None
udaexec = teradata.UdaExec ()
with udaexec.connect("MYTD") as session:
results = session.callproc("MYDB.MYPROC",
(teradata.OutParam("resultcode1"),
teradata.OutParam("resultstate1"),
teradata.OutParam("resultmsg1"),
teradata.InOutParam(vnull,"inout_schid"),
vjobid,vjobnm,1,vstarttm,"N","N"))
print(results.resultcode1)
print(results.resultstate1)
print(results.resultmsg1)
Got error in log, as follows
AttributeError: 'NoneType' object has no attribute 'raw'
The text was updated successfully, but these errors were encountered: