Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to know more about the DataType!
Message
 
 
To
All
General information
Forum:
Perl
Category:
DBI - Databases
Title:
Need to know more about the DataType!
Miscellaneous
Thread ID:
00413526
Message ID:
00413526
Views:
46
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.
Next
Reply
Map
View

Click here to load this message in the networking platform