in reply to Re^2: Executing multiple mysql commands in a single execute() call.
in thread Executing multiple mysql commands in a single execute() call.

Why cannot you take the results from your SELECT Team_ID query, and put it into a Perl variable? You can then, without much trouble, use it in all your further queries by passing it to $sth->execute($team_id, $other, $params)

What Corion was wondering about is, if you want to put multiple queries into one string and execute it, how would you read the results? How would you distinguish between the results of one query and the next one? (I don't think most database interfaces support multiple result sets.) How would jamming all the queries into a single string help readability?

We'd like to see some code from you, especially on how you call the database. You are using prepared queries, aren't you?

Replies are listed 'Best First'.
Re^4: Executing multiple mysql commands in a single execute() call.
by bimleshsharma (Beadle) on May 30, 2012 at 12:23 UTC
    why not you push value in variable( scalar,array- if multiple) and then use further. This is easy step to go ahead. For example.
    my $result = qx!kfsql -S Servername -D database -F e -s , -c \"select +field1 from test where criteria = "C" and some_date \!= $processdate +order by field_time desc\"!; if want to push in array then.. chomp $result; my @array= ($result=~ s/\"//g); this will push all result value into variable and you can use through +out in program.
    Hope this will help.