Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
There must be a better way of doing this?sub find_avaliable { # Create the SQL statement $sth = $dbh->prepare( "select CODE from INV where CODE = $user_inp +ut"); # Execute the SQL statement and generate a result set $sth->execute(); #Get results and process ($CODE) = $sth->fetchrow_array; if ($CODE ne "") { $user_input+=1; &find_avaliable; } else { #$COUT->Write("$user_input"); return; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding the next avaliable id in a SQLite database
by Ovid (Cardinal) on Apr 29, 2004 at 20:11 UTC | |
|
Re: Finding the next avaliable id in a SQLite database
by matija (Priest) on Apr 29, 2004 at 20:10 UTC | |
|
Re: Finding the next avaliable id in a SQLite database
by halley (Prior) on Apr 29, 2004 at 20:19 UTC | |
|
Re: Finding the next avaliable id in a SQLite database
by dragonchild (Archbishop) on Apr 29, 2004 at 20:07 UTC |