use DBI; print "Username: "; $uid = ; chop($uid); print "Password: "; $pwd = ; chop($pwd); my $dbh = DBI->connect('DBI:ODBC:test',$uid,$pwd,{ RaiseError => 1, AutoCommit => 0}) or die "Couldn't connect to database: " . DBI->errstr; print "Ident name: "; $ident = ; chop($ident); $ident = uc($ident); # This is to avoid case problems, in this system, all idents are uppercase print "Full name: "; $fullname = ; chop($fullname); print "Phone number: "; $phone = ; chop($phone); $sql = "create ident $ident as os_user"; $dbh->do($sql) or die "Could not create ident: " . DBI->errstr; $sql = "grant member on UINFO.USER_INFO_ACCESS_GROUP to $ident"; $dbh->do($sql) or die "Could not grant select access: " . DBI->errstr; $sql = "grant member on UINFO.USER_INFO_MODIFY_GROUP to $ident"; $dbh->do($sql) or die "Could not grant modify access: " . DBI->errstr; $sql = "insert into UINFO.USER_INFO(IDENT_NAME,FULL_NAME,PHONE) values (?,?,?)"; $sth = $dbh->prepare("$sql"); $sth->execute($ident,$fullname,$phone); $dbh->commit() or die "Could not commit: " . DBI->errstr; $dbh->disconnect(); exit;