Hello all,
I have three table name with same data structure. So, I want to insert my data through store procedure by passing table name as variable with my data. Is it possible?

Thanking You.
Hakoo Desai.

Recommended Answers

All 9 Replies

Yes you need to use Dynamic SQL.

Try this sample or this.

yes, you can pass field parameter as well as table name in stored procedure for inserting values

Can you provide sample code?

Have you gone through the previously provided link ?

Yes, I went though those links, but those are ambiguous for me. So, thats why I asked for sample code.

What the link contains is code only and that to exactly AS PER YOUR REQUIREMENT.

But if you do not understand the code all codes will be ambiguous for you.

Yes, I don't have deep knowledge of MySql. I am learner and trying to understand the things.

Then you need to read books and and try to understand the code.

Later you will be able to write your own code.

Thanking you for your suggestions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.