chexmix has asked for the wisdom of the Perl Monks concerning the following question:
I'm tearing my hair out over a problem, and I'd appreciate any guidance or pointers.
I worked very hard on an update to a script we use at work. My update involved using stored procedures instead of direct database (Sybase) queries. This way I could call the stored procedures and get back values identified as output params.
The construct looks like this:
my ( $thing_id, $action ); my $update_or_insert = $dbh1->prepare( qq/exec stored_procedure / . qq/\@p1 = ?, \@p2 = ?, \@p3 = ?, \@p4 = ?, \@p5 = ?, / . qq/\@p6 = ?, \@p7 = ?, \@p8 = ?, \@p9 = ?, / . qq/\@thing_id = ? output, \@action = ? output/); $update_or_insert->bind_param(1, $p1, SQL_INTEGER); $update_or_insert->bind_param(2, $p2, SQL_INTEGER); $update_or_insert->bind_param(3, $p3, SQL_INTEGER); $update_or_insert->bind_param(4, $p4, SQL_VARCHAR); $update_or_insert->bind_param(5, $p5, SQL_DATETIME); $update_or_insert->bind_param(6, $p6, SQL_VARCHAR); $update_or_insert->bind_param(7, $p7, SQL_VARCHAR); $update_or_insert->bind_param(8, $p8, SQL_VARCHAR); $update_or_insert->bind_param(9, $p9, SQL_VARCHAR); $update_or_insert->bind_param(10, $thing_id, SQL_INTEGER); $update_or_insert->bind_param(11, $action, SQL_VARCHAR ); $update_or_insert->execute(); ( $thing_id, $action ) = $update_or_insert->syb_output_params(); $update_or_insert->finish;
I got this working flawlessly in testing. But now I am running it in our 'shadow test' environment and am getting uninitialized value complaints for the bind_param statements for $thing_id and $action. Ultimately the script fails.
These were just as unitialized in my tests, but those runs didn't complain and they ran to completion.
To be fair, the input files to the program have changed some and have additional lines -- these new lines are skipped by default anyway, but I added a line of code to do it exolicitly.
I did figure out that our shadow test environment was running a different version of Perl. I fixed this: both are running 5.22.2, which is what I ran in my tests and what we run in production. This didn't help.
I confirmed that the same version of DBD::Sybase is being run in both places.
Is there something that could cause this that I am failing to consider? I asked our dba whether it could be Sybase-related but he said no.
Very tired. I could figure something out after I post this, but ...
Thanks,
Glenn
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ... something in the environment?
by Fletch (Bishop) on Feb 27, 2020 at 20:27 UTC | |
by chexmix (Hermit) on Feb 27, 2020 at 20:41 UTC | |
Re: ... something in the environment?
by jo37 (Deacon) on Feb 27, 2020 at 21:29 UTC | |
by chexmix (Hermit) on Feb 27, 2020 at 21:50 UTC | |
by bliako (Monsignor) on Feb 27, 2020 at 22:58 UTC | |
by chexmix (Hermit) on Mar 03, 2020 at 16:52 UTC | |
Re: ... something in the environment?
by Eily (Monsignor) on Feb 28, 2020 at 13:45 UTC | |
Re: ... something in the environment?
by hexcoder (Curate) on Feb 28, 2020 at 11:09 UTC | |
Re: ... something in the environment?
by Veltro (Hermit) on Feb 28, 2020 at 13:12 UTC | |
by chexmix (Hermit) on Feb 28, 2020 at 15:38 UTC | |
by Veltro (Hermit) on Feb 28, 2020 at 16:02 UTC |