Hi,
Is there any way to iterate through MySQL Result Hash multiple times ?
Current Problem: After One iteration, second iteration no records.
Need your help at the earliest.
Regards,
Sudheendra
Hi,
Is there any way to iterate through MySQL Result Hash multiple times ?
Current Problem: After One iteration, second iteration no records.
Need your help at the earliest.
Regards,
Sudheendra
On 23 August 2010 08:28, Sudheendra P. [email protected]
wrote:
Hi,
Is there any way to iterate through MySQL Result Hash multiple times ?
Current Problem: After One iteration, second iteration no records.
If you post the code you’re having a problem with, then maybe we can
make some suggestions.
Ideally, the smallest sample of the code that exhibits the problem
you’re experiencing so the model query and the loop should suffice.
Michael P. wrote:
On 23 August 2010 08:28, Sudheendra P. [email protected]
wrote:Hi,
Is there any way to iterate through MySQL Result Hash multiple times ?
Current Problem: After One iteration, second iteration no records.
If you post the code you’re having a problem with, then maybe we can
make some suggestions.Ideally, the smallest sample of the code that exhibits the problem
you’re experiencing so the model query and the loop should suffice.
Here goes the code
journal_details = conn.dbconnection.query(
“SELECT value,prop_key from Journal_Details
INNER JOIN journals on journals.id = journal_details.id
WHERE journalized_id = ‘#{issue_id}’ and
Date(created_on)=’#{date}’ ORDER By journals.id”
)
#The above is the query which results few records
journal_details.each_hash do |journal_details_record|
end
journal_details.each_hash do |journal_details_record|
processing.
end
Also I have tried with each method instead of each_hash. Same problem
continues.
Thank in advance for your help
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs