Quote Originally Posted by Lesiok View Post
But I think that after bindValue Your query looks like :
Qt Code:
  1. SELECT 'foo' FROM myTable
To copy to clipboard, switch view to plain text mode 
Try look at PostgreSQL logs.


Qt Code:
  1. SELECT 'foo' FROM myTable
  2. or
  3. SELECT foo FROM myTable
To copy to clipboard, switch view to plain text mode 

doesn't matter, since they work both.


my problem is that i used
Qt Code:
  1. QSqlQuery q(db);
  2. q.prepare("SELECT :bla FROM test");
  3. q.bindValue(":bla",someVariable);
To copy to clipboard, switch view to plain text mode 

in a project using qt < 4.5 to create some select queries and it doesn't work in qt 4.5 anymore, it works fine for insert statements though.

but since a solution like
Qt Code:
  1. query.prepare(QString("select %1 from mytable").arg("foo"));
To copy to clipboard, switch view to plain text mode 

works fine, i will use this. (should have done it like that in the first place)

thanks everybody for your help.