Hi Monks,
This code gets a value from another part of my program, as you can see I am just trying to pass a variable value into this subroutine, and when the program runs it ignores de $sql and the DB connection doesn't work. It generates an error like:
2002-04-09<[Thu Nov 11 09:39:18 2004] assignment.pl: DBD::ODBC::st fet +chrow_hashref failed: (DBD: no select statement currently executing err=-1) at assignment_c. +pl

I am trying to understand why the code retrieving the information is actually causing the sub routine not to work, but if a comment out the line:
my ($all_info) = shift (@_);

The program runs fine.
Thanks for the help!
Here is the code
There is more to the code, but all I would like to know is why this line is causing all my problems.
my ($all_info) = shift (@_);
sub C58MASTP { my $check; # retrieving argument my ($all_info) = shift (@_); if($X_NUM){$check=$X_Y;} if($all_info){$check=$all_info;} $sql= "SELECT C.mast1, C.mast2 FROM MASTER WHERE C.mast1=$check AND C +.mast2=$X_Y"; }

In reply to Value to Sub by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.