On Fri, Dec 14, 2001 at 11:56:49AM +0100, Steffen Goeldner wrote:
> Thomas A. Lowery wrote:
> 
> > I did change the where the ado_consts, myado_types* to attributes of
> > the database handler, instead of package variable. I was having some
> > "score" problems.
     scope ... <sigh>

> I already encountered problems after a reconnect to another data
> source. I think
> 
>   my $ado_type;
> 
> (line 433) is still problematic.

In reviewing this variable, and what it's used for, I need to revisit
this section of code.  $ado_type is only used in GetTypeInfo, which was an
early attempt to support "ODBC" defined functions.  I doubt this is
needed.  If it is, then I'll move to the inner db handle.

....
my $ado_type;
....

        # Get information from the current provider.
        sub GetTypeInfo {
                my($dbh, $attribs) = @_;
                my $sth;
                my $lastError;

        # If the type information is previously obtained, use it.
        unless (defined $ado_type) {
                $ado_type = &_determine_type_support;
        }

        my $sponge = DBI->connect("dbi:Sponge:","","",{ RaiseError => 1 });
        $sth = $sponge->prepare("adSchemaProviderTypes", {
                rows=>   [ @$ado_type ] , NAME=> $ado_info,
        });
        $sth;
    }


        sub type_info_all {
                my ($dbh) = @_;
                my $names = {
          TYPE_NAME             => 0,
          DATA_TYPE             => 1,
          COLUMN_SIZE           => 2,
          LITERAL_PREFIX        => 3,
          LITERAL_SUFFIX        => 4,
          CREATE_PARAMS         => 5,
          NULLABLE              => 6,
          CASE_SENSITIVE        => 7,
          SEARCHABLE            => 8,
          UNSIGNED_ATTRIBUTE    => 9,
          FIXED_PREC_SCALE      =>10,
          AUTO_UNIQUE_VALUE     =>11,
          LOCAL_TYPE_NAME       =>12,
          MINIMUM_SCALE         =>13,
          MAXIMUM_SCALE         =>14,
        };
                # Based on the values from the current provider.
                my @myti;
                my $sth = $dbh->func( DBI::SQL_ALL_TYPES(), 'GetTypeInfo' );
                while(my $row = $sth->fetchrow_hashref) {
                        my @tyinfo;
                        # Only add items from the above names list.  When
                        # this list explans, the code 'should' still work.
                        for my $n (keys %{$names}){
                                $tyinfo[ $names->{$n} ] = $row->{$n} || '';
                        }
                        push( @myti, \@tyinfo );
                }
                $sth->finish;
                my $ti = [ $names, @myti ];
                return $ti;
        }

Thanks!
> 
> Are you sure that

No ... I'm not sure.  I'll change it back.


>  $AdoType == $ado_consts->{adArray}
> 
> (line 1179) is correct? I have no example, but as I understand the
> docs, adArray is 'always combined with another data type constant'
> (I assume or'ed together). For example, if we have a type
> 
>   INTEGER ARRAY[]

> then - I guess! - ADO will return

>   adInteger | adArray

Tom


-- 
Thomas A. Lowery
See DBI/FAQ http://tlowery.hypermart.net

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

Reply via email to