Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Perl DBI not storing @prev_value in query

by poj (Abbot)
on Jan 25, 2018 at 18:55 UTC ( [id://1207916]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl DBI not storing @prev_value in query
in thread Perl DBI not storing @prev_value in query

I'm not sure exactly why it works

It works because the user defined variables need to be initialized. Because variables are session specific they are 'retained' when using MySQL workbench. You should notice that your original query does not work in MySQL workbench on the first run but then works on subsequent runs. Using DBD you are creating a new session each time so variables never get initialized. You could use your original query by adding a set command before the execute

$dbh->do('SET @recent_post_rank := 0, @prev_discussion := 0');
poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207916]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found