Interesting problem comparing strings with integer values...

Bengt Richter bokr at oz.net
Thu Jan 16 04:21:44 EST 2003


On 15 Jan 2003 18:29:54 -0600, Chris Spencer <clspence at one.net> wrote:

>	The comparison will not be done inside of a Python interpreter, but in
>an SQL statement. ie...
>select blah from table where value>"999" and value<"3432";
>
>We're storing arbitrary data in text blobs, so we can't make "value" above an
>integer type.
Does your SQL not have a "convert" from text to integer or float, so you can
write a conversion/comparison expression in SQL while storing only text?

Depending on your SQL, you might be also able to define an SQL view
that makes certain text fields or sub-strings thereof look like number columns
for purposes of SELECT.

Regards,
Bengt Richter




More information about the Python-list mailing list