On Friday, January 4, 2002, at 10:51 AM, Mitch Helle-Morrissey wrote:
>> why not use a NVL in your select staetment?
>
> The
> problem is that my selects are dynamic so I have no idea what types the
> columns are.
It is rare that SELECT statements are as dynamic as people claim.
You could create a condition matrix and map each point in the
matrix to a
predefined hard-coded SELECT statement. And you could also have
another matrix
with the typing for that SELECT statement.
In other words, most people think that this form of dynamism:
if ($cgi->param('limit')) {
then $SQL .= sprintf "LIMIT %d", $cgi->param('limiit');
}
can't be handled in a less-dynamic way, but it can. Simply map
out all your
conditions and point to the pre-written SQL statement.