use strict; use Win32; use warnings 'all'; use Win32::ODBC; my $dsn = "test"; my $srv_tbl = "server_tbl"; my $drv_tbl = "drives_tbl"; my $srv = shift @ARGV; my $loc = shift @ARGV; my $notes = pop @ARGV; my $db = new Win32::ODBC( $dsn ) || die "\nError! $^E:$!\n"; $db->Sql("INSERT INTO $srv_tbl (srv_name, location, notes) VALUES ('$srv','$loc','$notes')"); my $sql= “select srv_id from server_tbl where srv_name='$srv'”; #this bit doesn’t work print "Index Key: $sql\n"