hi pleas i need help if it's possible ; i have a c++ code which can select from a DB but i can't do the code for insert a new data in my data base .

Recommended Answers

All 4 Replies

What kind of database are you using? SQL, like MS-Access and MySQL?

actually i m using oracle

First you need to learn SQL. If you alreay have that down pat then just create the UPDATE string and send it to the DB like you do the SELECTs. From c++ perspective there is no difference between the two, its just that queries are a little more difficult than updates because you have to process the result sets from queries.

If you re having problems writing the UPDATE string then post what you have so that we can provide specific help. You basically have to expand the string to include the value of all variables, much like you do when displaying it on the console screen. std::stringstream class can help you out with that.

if you can give me an exemple that will be a great cause i know that i have to use this reguest " insert into table() values ..." but how ?!! no idea

Be a part of the DaniWeb community

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