I have a Z SQL object which returns Missing.Value How do I preform a check for Missing.Value in python? \Oliver
Dieter Maurer wrote:
Oliver Marx writes:
I have a Z SQL object which returns Missing.Value
How do I preform a check for Missing.Value in python? I would change the database adapter. It should return None rather than "Missing.Value".
Dieter
Well, do you know of a working DA for MSSQL for windows which works? ;) I the adapter was Open Source we would go a fix the bug - but it isn't! egenix is coding on a ODBC DA AWS but they will release it under a commercial license - which is ok - but not perfect in this case. We are working for a goverment agency and they *want* a Open Source solution. \Oliver
Oliver Marx writes:
Well, do you know of a working DA for MSSQL for windows which works? ;) I the adapter was Open Source we would go a fix the bug - but it isn't! egenix is coding on a ODBC DA AWS but they will release it under a commercial license - which is ok - but not perfect in this case. Fortunately, I only rarely need to work with MS products.
When you work under Windows, then there is ZmxODBCDA, a DA on top of "egenix" (yes commercial) mxODBC. I do not know whether it does have your problem, but I expect it will not. This is not the "mxODBCDA", now under development by egenix. When I need to interface with MSSQL (I am then on a Unix plattform), I use either SQLRelay or the SybaseDA both over FreeTDS. I did not yet met a "Missing.Value". This does not necessarily mean, there is none.
We are working for a goverment agency and they *want* a Open Source solution. The "egenix" software *IS* open source, just not without costs.
Dieter
The catalog for my CMF returns Missing.Values as well. It comes from Missing.pyd, but I don't remember seeing that in Python before though. Anyway, read in the Python Scripts for how to allow access to things like this. Essentially somewhere on the filesystem you need to do: from Products.PythonScripts.Utility import allow_module allow_module('Missing') Then within a Script (Python ) you can do: import Missing if same_type(value, Missing.MV): # do something Just found this out when I tried to ram cache a dict made up of catalog metadata, and found ram cache couldnt dump Missing.Value... Hope that helps. -- Andy McKay www.agmweb.ca
participants (3)
-
Andy McKay -
Dieter Maurer -
Oliver Marx