Qt-interest Archive, March 2002
QSqlCursor
Message 1 in thread
I am trying to use QSqlCursor using the QOCI8 driver on an Oracle 8.1.7
database. I am not getting any data from my select. In fact, isValid()
returns false when I try a select.
.
.
.
QSqlCursor myCurs("TABLE_NAME",true, dbGUI);
.
.
.
When ran, the error is "...table not found. Make sure the table
exists...." (Or something similar.)
The dbGUI is valid and connected to, I've checked that.
I can do a select on the table from the SQL prompt, I've checked that.
I've even fully qualified the name with OWNER.TABLE_NAME notation in Qt and
it still won't work.
Has anyone had similar problems and can offer some advice?? By the way,
QSqlQuery will work fine, but I was hoping to use QSqlCursor.
Rob Simmermon simmermon@usgs.gov
Programmer Analyst, Software Engineering Services
Raytheon ITSS
EROS Data Center
Sioux Falls, SD 57198
Tele - 605.594.2611
Fax - 605.594.6940
Message 2 in thread
On Wednesday 06 March 2002 21:32, Robert Simmermon wrote:
> I am trying to use QSqlCursor using the QOCI8 driver on an Oracle 8.1.7
> database. I am not getting any data from my select. In fact, isValid()
> returns false when I try a select.
>
> QSqlCursor myCurs("TABLE_NAME",true, dbGUI);
>
> When ran, the error is "...table not found. Make sure the table
> exists...." (Or something similar.)
>
> The dbGUI is valid and connected to, I've checked that.
> I can do a select on the table from the SQL prompt, I've checked that.
> I've even fully qualified the name with OWNER.TABLE_NAME notation in Qt and
> it still won't work.
>
> Has anyone had similar problems and can offer some advice?? By the way,
> QSqlQuery will work fine, but I was hoping to use QSqlCursor.
This is very strange, since QSqlCursor is just a subclass of QSqlQuery. So if
QSqlQuery( "SELECT * FROM TABLE_NAME", dbGUI)
works, then something very strange is going on. Can you debug into the driver
and see where exactly the error occurs?
Note that you have to call ::select before you can access the cursor.
Best regards,
Harald
Message 3 in thread
I tried the select() also, and I get no errors. I know the table has rows,
but the "next()" does not give me a valid QSqlRecord. I tried printing
myCurs.lastError() and myCurs.lastQuery() and I get nothing. No output at
all.
I'm not sure. This is kind of weird, like you say, since it simply extends
QSqlQuery.
Rob Simmermon simmermon@usgs.gov
Programmer Analyst, Software Engineering Services
Raytheon ITSS
EROS Data Center
Sioux Falls, SD 57198
Tele - 605.594.2611
Fax - 605.594.6940
Harald Fernengel
<harald@trolltech.com To: simmermon@usgs.gov, qt-interest@trolltech.com
> cc:
Sent by: Subject: Re: QSqlCursor
owner-qt-interest@tro
lltech.com
03/06/02 03:16 PM
Please respond to
harald
On Wednesday 06 March 2002 21:32, Robert Simmermon wrote:
> I am trying to use QSqlCursor using the QOCI8 driver on an Oracle 8.1.7
> database. I am not getting any data from my select. In fact, isValid()
> returns false when I try a select.
>
> QSqlCursor myCurs("TABLE_NAME",true, dbGUI);
>
> When ran, the error is "...table not found. Make sure the table
> exists...." (Or something similar.)
>
> The dbGUI is valid and connected to, I've checked that.
> I can do a select on the table from the SQL prompt, I've checked that.
> I've even fully qualified the name with OWNER.TABLE_NAME notation in Qt
and
> it still won't work.
>
> Has anyone had similar problems and can offer some advice?? By the way,
> QSqlQuery will work fine, but I was hoping to use QSqlCursor.
This is very strange, since QSqlCursor is just a subclass of QSqlQuery. So
if
QSqlQuery( "SELECT * FROM TABLE_NAME", dbGUI)
works, then something very strange is going on. Can you debug into the
driver
and see where exactly the error occurs?
Note that you have to call ::select before you can access the cursor.
Best regards,
Harald
--
[ signature omitted ]