in reply to Re: Return variable hangs script
in thread Return variable hangs script
Yes, it's a normal array. We create it as a "placeholder" to build the longer string. The array ref contains array refs of strings from a database column, that look like this:
12345678-abcd-4321-wxyz-wufht83nwi03
They're all unique. We need to fetch all the strings, then quote them and string them together. That resulting long string is passed to a subsequent SQL query as an IN ('...') conditional.
Here's what I'm doing, in more detail:
my ($aref, $acount, @temparray, $tcount);
$aref = GetArrayRef($dbh,$sqlquery);
$acount = @$aref; # results in n
foreach (@$aref) {
push(@temparray,qq('$_[0]') );
}
$tcount = @temparray; # should also equal n, and does.
After we create @temparray, we join all the elements to a string. We have to quote the strings or else Oracle will not parse the query correctly.
The problem is that when we return $tcount to the caller, it hangs. $acount passes fine.
I've double checked everything, including any called modules, and everything seems fine.
Odd.