On Wed, Oct 31, 2001 at 09:26:14AM +0100, Steffen Goeldner wrote:
> Attached is *not* a patch - it's a first cut and a cry for help!
> I have problems mapping the ADO fields to SQL/CLI (ODBC, DBI)
> fields, especially the datatype related fields.
> I guess that the magic DBD::ADO::_determine_type_support() may
> provide part of a solution.
> Any suggestions, hints, insides, patches, ... are welcome!

> BTW: It seems, that the statement handle attributes need the
>      same mapping.

Now that I'm looking at this again I remember why I skipped it ;->

> 
>       sub column_info {

I'm beginning to remember why converting ADO to the SQL/ODBC was such a
pain:  Take a simple example of what OpenSchema(adSchemaProviderType)
returns verse what the table column types return.

The Provider supports:

-> data type Short:          2 
-> data type Long:           3 
-> data type Single:         4 
-> data type Double:         5 
-> data type Currency:       6
-> data type DateTime:       7
-> data type Bit:           11
-> data type Byte:          17
-> data type GUID:          72
-> data type BigBinary:    128
-> data type LongBinary:   128
-> data type VarBinary:    128
-> data type LongText:     130
-> data type VarChar:      130
-> data type Decimal:      131

However, my table columns types are
                Number:     5 (adDouble)
        Text:     202 (adVarWChar)
        Number:   131 (adNumeric)
        Number:   131 (adNumeric)
        Date/Time:  7 (adDate)
        Memo:     203 (adLongVarWChar)

Type 5   is     supported at mytest.pl line 36
Type 202 is not supported at mytest.pl line 36
Type 131 is     supported at mytest.pl line 36
Type 131 is     supported at mytest.pl line 36
Type 7   is     supported at mytest.pl line 36
Type 203 is not supported at mytest.pl line 36

So the Provider does not supply any information on how to support
data types adVarWChar and adLongVarWChar. 

Converting from the an ADO type to the SQL/ODBC type, without support
from the provider, may be difficult.
We'll need to look at more then just the type in an attempt to map it.
As the provider above shows, the same data type may have different
column type depending on the other attributes:

                 TYPE_NAME 
                *DATA_TYPE 
                *COLUMN_SIZE 
                 LITERAL_PREFIX 
                 LITERAL_SUFFIX 
                 CREATE_PARAMS 
                 IS_NULLABLE 
                 CASE_SENSITIVE 
                 SEARCHABLE 
                *UNSIGNED_ATTRIBUTE 
                *FIXED_PREC_SCALE 
                *AUTO_UNIQUE_VALUE 
                *LOCAL_TYPE_NAME 
                 MINIMUM_SCALE 
                 MAXIMUM_SCALE
                 GUID 
                 TYPELIB 
                 VERSION 
                *IS_LONG 
                *BEST_MATCH 
                *IS_FIXEDLENGTH 

I'll look at mapping the SQL_* types to ADO attributes.

Tom

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to