Re: getlist question



Victor Subervi wrote:
On Fri, Dec 25, 2009 at 11:35 AM, Carsten Haese <carsten.haese@xxxxxxxxx
<mailto:carsten.haese@xxxxxxxxx>> wrote:

Victor Subervi wrote:
> Well I've done that. What happens is the storeColNames registers the
> "Availability" field naturally enough; however, as I stated
before, the
> getlist doesn't fetch anything because there is nothing to fetch! No
> such value is passed!

Well, what does getlist return when the situation you're describing as
"getlist doesn't fetch anything" occurs? Does is raise an exception?
Does it return 0? Does it return None? Does it return an empty list? An
empty string? An empty tuple? Does it return False? Does it not return
at all and causes the universe to fall into a black hole?


It returns nothing. I believe I've stated that three times now.

Bzzzt! Wrong! "Nothing" is not a Python object, and stating it three
times doesn't make it any less wrong. The result you're getting is a
Python object. It might represent Nothingness to you, but it's not
nothing. Try to find out what that object is, so that you can then use a
Python if-statement to check whether the return value you're getting is
such an object.


So, what I need to do is figure out a way to log
> the fact that no value is fetched. What I have currently,
unfortunately,
> simply ignores the unfetchable value. As I stated before, I need
to log
> the fact that no such value is obtained. Please...how do I do that??

Please be less vague. What part do you have a problem with? Checking
whether "no value is fetched" or "log the fact"?


No value is fetched because there is no value to fetch. I want to be
able to log the fact that no value was fetched. How do I do that? Am I
not being clear? Here, let me try again, as I began this thread with my
first post. I thought it was so easy, so clear. If I use getfirst, I can
set a default to log whether getfirst gets anything or not. I cannot do
that with getlist. Is there a work-around?

See above. Try to find out what kind of object it does return in the
case that's causing you grief, and then devise a Python if-statement to
test for that object. Hint: Use type() and repr() to find out what
getlist() is returning.

--
Carsten Haese
http://informixdb.sourceforge.net

.



Relevant Pages

  • Re: getlist question
    ... Victor Subervi wrote: ... "Availability" field naturally enough; however, as I stated before, the ... getlist doesn't fetch anything because there is nothing to fetch! ... Does it return an empty list? ...
    (comp.lang.python)
  • Re: Splitting file
    ... No row was found for FETCH, UPDATE or DELETE; ... query is an empty table. ... UPDATE TABLE1 SET ... ...
    (comp.unix.shell)
  • Re: List thread safety question
    ... > Actually I fetch the first item from the List, to process it, ... This will still loop until the queue is empty, ... It might also need a PulseAll or something at ... the end of each iteration to invite the other threads to the party... ...
    (microsoft.public.dotnet.languages.csharp)
  • Right click > New list
    ... When you Right-click> New on an empty place ... you fetch up a list of file types that you can create. ... There's an item in it that I want to get rid of. ...
    (microsoft.public.windowsxp.general)
  • Re: Deleting rows from a table in SQL
    ... SQL0100W No row was found for FETCH, UPDATE or DELETE; ... query is an empty table. ... If your able to interrogate sql error or state and ... Then when you want to empty it: ...
    (comp.lang.rexx)