in reply to Calling MySQL stored procedures with in and out parameters
my $var_with_chars = "a string"; my @result = []; $sql = 'call register_hit(?, @hit_count)'; #watch out for the "@"! my $sth = $db_handle->prepare($sql); $sth->execute($var_with_chars) || die $DBI::errstr; $sth->finish; # Now get the output variable @result = $db_handle->selectrow_array('SELECT @hit_count'); # || die $DBI::errstr; print "result=", $result[0], "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling MySQL stored procedures with in and out parameters
by Benedict White (Novice) on Mar 24, 2010 at 15:12 UTC | |
|
Re^2: Calling MySQL stored procedures with in and out parameters
by morning_leaf (Initiate) on Apr 06, 2015 at 01:26 UTC | |
by hippo (Archbishop) on Apr 06, 2015 at 08:41 UTC | |
by morning_leaf (Initiate) on Apr 06, 2015 at 15:25 UTC | |
by morning_leaf (Initiate) on Apr 06, 2015 at 15:39 UTC |