Problem Related to storing the field value in a String

Поиск
Список
Период
Сортировка
От aravind chandu
Тема Problem Related to storing the field value in a String
Дата
Msg-id 672219.10831.qm@web31404.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: Problem Related to storing the field value in a String  ("Grzegorz Jaśkiewicz" <gryzman@gmail.com>)
Список pgsql-general
Hello Guys,

                    The following is my sample program

 result R(T.exec("select * from emp"));
string L;
stringstream S;
 vector<string> v;
int z,i;
 z = R.size();

for (i = 0;i<z ;i++){
// Write field's string into S
S << R[i][0];

// Parse contents of S into L
S >> L;
v.push_back(L);
}

There is a table emp with single column,while I am working on thismodule I encountered a problem,I can able to get the first
row of the table only,I am not able to get the other row values.

Lets say column values are abc,def,ghi.jkl etc.... There is no problem with R[i][0] its getting the correct values,
but the problem is while reading field values into 'S' I am able to get only the table's field value of first row only and the rest as zero's.
I don't know what's the problem.Can you guys please help me to solve this problem.

If there is another way to store field value into a string please let me know.

Thanks,
Avin.


В списке pgsql-general по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Problems With Bad PID and Missing Socket -- UPDATE
Следующее
От: Madison Kelly
Дата:
Сообщение: SELECT DISTINCT ... ORDER BY problem