hi lykurg!
I am able to do what i had asked for, but in a little different way. the code is:
void MainWindow::insert_remote()
{
QSqlQuery query
(db2
);
///////////db2 is for sqlite int id;
query_remote.setQuery("select * from user20",db); ///////////user20 is the table of db
rowcount= query_remote.rowCount(); ///////////user200 is the table of db2
int j=0;
while(j!=rowcount)
{
id = query_remote.record(j).value("ID").toInt();
name = query_remote.record(j).value("NAME").toString();
query.
exec("insert into user200(Id,Name) values("+QString::number(id
)+",'"+name
+"')");
j++;
}
query_remote.clear();
}
void MainWindow::insert_remote()
{
QSqlQueryModel query_remote; ///////////db is for mssql
QSqlQuery query(db2); ///////////db2 is for sqlite
int id;
QString name;
query_remote.setQuery("select * from user20",db); ///////////user20 is the table of db
rowcount= query_remote.rowCount(); ///////////user200 is the table of db2
int j=0;
while(j!=rowcount)
{
id = query_remote.record(j).value("ID").toInt();
name = query_remote.record(j).value("NAME").toString();
query.exec("insert into user200(Id,Name) values("+QString::number(id)+",'"+name+"')");
j++;
}
query_remote.clear();
}
To copy to clipboard, switch view to plain text mode
The remote mssql server is on a different p.c and my local sqlite is on my p.c. Sorry, due to lack of time i am not able to work out on your method. So, when i am running this application on my p.c, it is working fine and copy of table records from mssql to sqlite is happening.
But, now the main thing is i have to run the same application on my arm-linux-embedded system. I am able to run even on the embedded board and do the neccessary copy.
But now i'm getting one more problem i.e the following error:
qGetStringData: Error while fetching data ( "[FreeTDS][SQL Server]Program type out of range" )
qGetStringData: Error while fetching data ( "[FreeTDS][SQL Server]Program type out of range" )
To copy to clipboard, switch view to plain text mode
The integer and float values are coming fine, but when it comes to string data, it shows the above error.
So, can you tell me, what is the problem? Are the exact libraries associated with QString missing or something like that?
thanking in advance,
Bookmarks