473,382 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Execute query which is fetched from a table using MySQL

I am using ruby on rails.
Hence through my controller I am fetching the list of data(query strings saved in the database) on the basis of some condition. Now I need to execute these queries.
Do any one know how to do this?
Jun 15 '11 #1
6 4085
improvcornartist
303 Expert 100+
You should be able to execute the queries in the same way you fetch them. If not, you could maybe use something like DBI to connect to the database.
Jun 15 '11 #2
hi improvcornartist,
I think you did'nt get me.
I am using MySql and I have a table where one column namely "action" contains certain queries.
Now, in controller I wrote a method which is able to fetch the data from the column but I want to execute the same.
What will the command for that in ruby on rails.
Thank you
Jun 15 '11 #3
Rabbit
12,516 Expert Mod 8TB
They are saying that you can use the same command you use to fetch the data to execute the SQL string in the data that you fetched.
Jun 15 '11 #4
no not at all we can't.
When the data is fetched from the table its just like a string fetching. Here, in the case the data fetched is in a query format itself eg( Select * from tablename). So, I need to apply the execution command on the data which is fetched through the method in the controller.
Jun 15 '11 #5
Rabbit
12,516 Expert Mod 8TB
How are you executing the query that gets the data in the first place?
Jun 15 '11 #6
Frinavale
9,735 Expert Mod 8TB
This thread has been closed because the question is to vague. If you have a specific question about how to use MySql with Ruby/Ruby On Rails please start a new thread with your question.
Nov 2 '12 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Bordas | last post by:
Hi list, I've got a little bug with MySQL. I can insert a row into my table but this row will not appear in the table :( Server is under linux redhat, MySQL is 3.23.56 installed from binary...
3
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
2
by: Derek Griffiths | last post by:
Basically I'm just trying to get my program to make a simple table. Lucky for me that I choose to start with the simple ones I suppose. Here's the SQL command I am trying to run: "CREATE TABLE...
2
by: RottNKorpse | last post by:
Well I am trying to make an admin section to allow my other admins of my site able to add content to my mysql database without giving them phpmyadmin access and without teaching them out to use it as...
14
by: Ben | last post by:
I don't know whether anyone can help, but I have an odd problem. I have a PSP (Spyce) script that makes many calls to populate a database. They all work without any problem except for one...
1
by: Bilwin | last post by:
Hi friends, i am a newbie to mysql. i am using mysql 5.0 and db designer 4. I have created a schema in DB designer and i connected to mysql 5.0 server. When i tried to exceute the sql script in...
3
by: FNA access | last post by:
Hello all, I am relitivley new to mySQL. I started by downloading from the mySQL site. I then downloaded mySQL administrator and mySQL Query browser. With my set up I got a user root with a...
3
by: Aric Green | last post by:
I have a form that contains customer information. I want to use the ID_NUMBER to query another table (when I click a button) to return the record that matches that ID_NUMBER. What is the easiest...
1
by: theschaef | last post by:
Hi there. I am using perl to connect to a database and then pull the rows off of the table one by one to manipulate the data. If I use a smaller table (~8 MB), I wait for around 20 seconds but...
3
by: liosbeg | last post by:
I have a html code writtin which calls a php page.(this much works perfectly). In the html the user has a choice of 5 artists from a drop down menu. When the choose the artist I want it to call...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.