> I have an Oracle DBI program that got along just fine when I said "if
> ($sth->{TYPE}->[$col] == 12)".
> Now I've had to support SQL Server,
> and had to change the line to "if ($sth->{TYPE}->[$col] !~ /
> ^[456]$/)".  (Yes, i know that isn't real efficient, I plan to change
> it later.)
>
> Does anyone have code to scan the results of type_info_all and return
> which types are numeric (i.e. can be summed) and which aren't?

 switch (sql_type) {
    case SQL_NUMERIC:
    case SQL_DECIMAL:
    case SQL_INTEGER:
    case SQL_BIGINT:
    case SQL_TINYINT:
    case SQL_SMALLINT:
    case SQL_FLOAT:
    case SQL_REAL:
    case SQL_DOUBLE:

are all the SQL types that can be summed.



Reply via email to