Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not pass a NULL INPUT parameter to stored procedure #58

Closed
alokagg opened this issue Oct 13, 2016 · 2 comments
Closed

Can not pass a NULL INPUT parameter to stored procedure #58

alokagg opened this issue Oct 13, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@alokagg
Copy link

alokagg commented Oct 13, 2016

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'

@escheie escheie added the bug label Oct 13, 2016
@escheie escheie added this to the 15.10.00.19 milestone Oct 13, 2016
@escheie escheie self-assigned this Oct 13, 2016
@escheie
Copy link
Contributor

escheie commented Oct 13, 2016

I am able to reproduce the problem. I will release a fix shortly. Thanks for reporting.

@escheie escheie changed the title can not pass a NULL parameter to stored procedure Can not pass a NULL INPUT parameter to stored procedure Oct 14, 2016
@escheie escheie reopened this Oct 14, 2016
@escheie
Copy link
Contributor

escheie commented Oct 14, 2016

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.

@escheie escheie modified the milestones: 15.10.00.20, 15.10.00.19 Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants