Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1100857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:56:51+00:00 2026-05-17T00:56:51+00:00

How to select a value from a table and store in a variable in

  • 0

How to select a value from a table and store in a variable in my sql++

e.g select name from employee;

write this query in c++ and then store the name in variable e_name


I googled and I know the mysql++ tutorials tell this code but I was connecting differently… can you see what is the problem with this.

mysql_init(&mysql);
connection = mysql_real_connect(&mysql,……….)

dheck for connection else do this

std::ostringstream query3;
query3<<"select pipe_id from pipe where version_id='"<<id<<"'";
std::storeQueryResult ares=query3.store();
for(size_t i=0;i<ares.num_rows();i++)
    cout<<ares[i]["version_id"]<<ares[i]["pipe_id"]<<std::endl;
mysql_query(&mysql,query3.str().c_str());

the erroer is that store is not a member of ostringstream.
thats i understood but in above so how should i proceeed
any hints

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:56:52+00:00Added an answer on May 17, 2026 at 12:56 am

    See the mysql++ tutorial:

    http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html#simple

    The relevant code:

    mysqlpp::Query query = conn.query("select item from stock");
    if (mysqlpp::StoreQueryResult res = query.store()) {
        cout << "We have:" << endl;
        for (size_t i = 0; i < res.num_rows(); ++i) {
            cout << '\t' << res[i][0] << endl;
        }
    }
    

    In this example, the results of the query are stored in the res variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This works: from x in table.AsEnumerable() where x.Field<string>(something) == value select x.Field<decimal>(decimalfield); but, this
Please, help me with join results of commands (MS SQL): SELECT name,value FROM table1
How do I store a selected field value into a variable from a query
Basically I want to alter the boolean value selecting from the table: e.g.: SELECT
SELECT MAX(some_field) FROM table_A GROUP BY another_field This only gets the max value of
I am trying to select minimum and maximum value for capacity from MySQL table
Is there a mysql syntax that can preform a select values from a table,
i have a question how to select certain values from a table. I have
I want to select value from select list in RSpec . For example i
What I'm trying to do is, I'm asking user to select a value from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.