Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, July 2004
Re: [qt] Re: bindValue for dinamic table name in select query.


Message 1 in thread

Probably it is worth to mention that:

With most drivers, placeholders can't be used for any
element of a statement that would prevent the database
server from validating the statement and creating a
query execution plan for it. 
                       taken from the DBI man page


regards,
Rado



> Sigh.........
> 
> What should I do, now?
> 
> is there anyway out to make one select query function
> but I can call this function for several tables?
> 
> Thanks a lot in advance.
> --- Chris Thompson <chris@centralsewing.com> wrote:
> > On July 9, 2004 06:39 am, Prabu Subroto wrote:
> > > Dear my friends...
> > >
> > > Can I use "bindValue" to make dynamic select
> > query?
> > >
> > > But my code return error.
> > >
> > > Here is my code :
> > >     QSqlQuery periksa(db);
> > >     QString tabelkok =
> > > pilihtabelcomboBox->currentText();
> > >     periksa.prepare("select count(*) from
> > :tabel");
> > >     periksa.addBindValue(":tabel", bindtabelkok);
> > >     periksa.exec();
> > >
> > >     if (!periksa.isActive()){
> > > 	periksa.lastError().showMessage();
> > >     }
> > >
> > > Once I do the with :
> > > periksa.prepare("select count(*) from sales");
> > >
> > > not with bindValue the query runs properly.
> > >
> > >
> > > Please tell me how to make one select query
> > function
> > > but I can call for several tables.
> > 
> > I have never been able to get it to work properly
> > with SELECT statements and 
> > have had other people write me noting similar
> > problems with different 
> > databases (I use MySQL).  I suggest not using
> > bindValue with SELECT 
> > statements.
> > 
> > Why hasn't this been reported to qt-bugs?  I have
> > not yet had the time to 
> > write up a test program to determine if this really
> > is a problem or if I have 
> > some other bug in my code.
> > 
> > -- 
> > chris@centralsewing.com, chris@hypocrite.org
> > 
> > --
> > List archive and information:
> > http://lists.trolltech.com/qt-interest/
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail 
> 
> --
> List archive and information: http://lists.trolltech.com/qt-interest/


Message 2 in thread

Hello,

QGroupBox can have a checkbox in the title by enabling the checkable
property.  Is there a standard way to produce a QGroupBox with a radio
button in its title?

Thanks,

Rob Smallshire

Dr Rob Smallshire
Development
Midland Valley
rob@mve.com

Download your *free* 4DVista visualizer
now at http://www.mve.com