Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to know more about the DataType!
Message
 
À
Tous
Information générale
Forum:
Perl
Catégorie:
DBI - Bases de données
Titre:
Need to know more about the DataType!
Divers
Thread ID:
00413526
Message ID:
00413526
Vues:
45
I have the following code (snippets) to create my insert SQL queries.
    #Prepare Table Field Defenitions 
    foreach ($dbh->tables()){ 
        next if /MSys.*/; 
        $sth = $dbh->prepare("SELECT * FROM $_ WHERE 0=1"); 
        $sth->execute(); 
        $table{$_} = {Field => \@{$sth->{NAME}}, 
                      Type  => \@{$sth->{TYPE}}}; 
    } 
    $sth->finish(); 
        $sql = "INSERT INTO $_ (".join(",",@{$table{$_}{Field}}).") VALUES (" . "?,"x$#{$table{$_}->{Field}} . "?)"; 
       $insert{$_} = $dbh->prepare($sql); 
    } 
But I need a way to know if the field is an autonumber field (b/c I don't want it included in the insert sql) I am using an access Database for now but will be converting to SQL7. If you know a better way to do the ID fields that would be appreciated as well.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform