How to save the record in table using SQL query

M

Mitesh Jain

Hello All,

how to execute

insert into employ values('mitesh',1);

how to execute this directly with out using .save function.

Thanking you
 
A

akbarhome

Hello All,

how to execute

insert into employ values('mitesh',1);

how to execute this directly with out using .save function.

Thanking you

What is your context?
Here is my guess. How about this: YourClass.executeQuery("insert into
employ values('mitesh',1)");
 
B

Brian Candler

Hello All,

how to execute

insert into employ values('mitesh',1);

how to execute this directly with out using .save function.

At a complete guess - since you don't say so yourself - I think you're using
Rails / ActiveRecord. In that case, the RoR google group is a better place
to ask.

But you could try:

YourModel.connection.execute("insert into employ ...")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,241
Messages
2,571,221
Members
47,856
Latest member
mmorais

Latest Threads

Top