dbTalk Databases Forums  

Error when fetching data of a Union query with Version 2.1.0

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Error when fetching data of a Union query with Version 2.1.0 in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Etienne Hirt
 
Posts: n/a

Default Error when fetching data of a Union query with Version 2.1.0 - 04-11-2006 , 01:58 PM






While fetching data from a union query as shown in the code fragment
below I get the following error when fetching the data from the second
part which is only one row. The same behaviour is found when using a
similar query also limited to one row:
Untreated Exception at 0x102163d4 (msvcr71d.dll) in analysis.exe:
0xC0000005: AccessError-Writeposition 0x20333535.

The data access crashes when I either want to assign a row to the SSQL
struct dbEvent or when accessing to the data with row["name"] .

Is there another option to access the data?

Etienne

//set up query
sprintf(queryString, "(Select * from event where Measurements_ID =
'%.4d-%.2d-%.2d %.2d:%.2d:%.2d' and Event_DataFilePos >= %d and
Event_DataFilePos <= %d order by Event_DataFilePos)",
m_startYear, m_startMonth, m_startDay, m_startHour,
m_startMinute, m_startSecond, dataFileFirstPosition, dataFileLastPosition);
sprintf(queryString,"%s UNION DISTINCT (Select * from event
where Measurements_ID = '%.4d-%.2d-%.2d %.2d:%.2d:%.2d' and
Event_DataFilePos >= %d and Event_Type = 'p' order by Event_DataFilePos
ASC LIMIT 1)",
queryString, m_startYear, m_startMonth, m_startDay,
m_startHour, m_startMinute, m_startSecond, dataFileLastPosition,
dataFileLastPosition);

resUse = query.use(queryString);

//Access data from query
while (row = resUse.fetch_row())
{
dbEvent = row;
//event[counter].dataFilePosition = row["Event_DataFilePos"];



--
++++++++++++++++++++++++++++++++++++++++++++++
Dr. Etienne Hirt Art of Technology
Director R&D www.art-of-technology.ch
Technoparkstrasse 1 Ph: +41-43-311 77 02
8005 Zurich Sw: +41-43-311 77 00
Switzerland
==============================================


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Error when fetching data of a Union query with Version 2.1.0 - 04-13-2006 , 06:41 AM






Etienne Hirt wrote:
Quote:
While fetching data from a union query as shown in the code fragment
below I get the following error when fetching the data from the second
part which is only one row. The same behaviour is found when using a
similar query also limited to one row:
Some of the examples use this same mechanism, so I'd be surprised if the
bug is truly in MySQL++.

Were you have to use an earlier version successfully?

Have you tried running the examples?

It says you aren't catching an exception: is this code wrapped in a try
block?

What is the type of this dbEvent data structure?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Etienne Hirt
 
Posts: n/a

Default Re: Error when fetching data of a Union query with Version 2.1.0 - 04-14-2006 , 10:02 AM



Dear Warren,

Thanks for the questions. Please find some answers and questions below

Warren Young wrote:

Quote:
Etienne Hirt wrote:

While fetching data from a union query as shown in the code fragment
below I get the following error when fetching the data from the
second part which is only one row. The same behaviour is found when
using a similar query also limited to one row:


Some of the examples use this same mechanism, so I'd be surprised if
the bug is truly in MySQL++.
I found no union query. Do you mean multiple queries?

Quote:
Were you have to use an earlier version successfully?
I did not use an earlier version

Quote:

Have you tried running the examples?
Which one do your recommend for testing? Is it the multiple query?

Quote:

It says you aren't catching an exception: is this code wrapped in a
try block?
yes but only mysql specific

Quote:

What is the type of this dbEvent data structure?
Its an SSQL:
sql_create_11 (Event, 2, 11, string, Measurements_ID, int32,
Event_DataFilePos,
mysqlpp::sql_char, Event_Type, int32, Event_Lat, int32,
Event_Lon,
int16, Event_Height, int16, Event_Speed, int16,
Event_Direction,
int16, Event_Accuracy, uint16, Event_Fix, string,
Event_Comment)





--
++++++++++++++++++++++++++++++++++++++++++++++
Dr. Etienne Hirt Art of Technology
Director R&D www.art-of-technology.ch
Technoparkstrasse 1 Ph: +41-43-311 77 02
8005 Zurich Sw: +41-43-311 77 00
Switzerland
==============================================


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Warren Young
 
Posts: n/a

Default Re: Error when fetching data of a Union query with Version 2.1.0 - 04-14-2006 , 05:37 PM



Etienne Hirt wrote:
Quote:
Some of the examples use this same mechanism, so I'd be surprised if
the bug is truly in MySQL++.

I found no union query. Do you mean multiple queries?
No, I simply mean the model of calling use() to get a result set and
then accessing the data with operator[](const char*).

Quote:
Have you tried running the examples?

Which one do your recommend for testing?
Run all of simple* and custom* at least. If any of them fail, that
could be a useful clue.

Quote:
What is the type of this dbEvent data structure?

Its an SSQL:
Ah, that could be the problem. Try accessing the data fields directly,
instead of assigning it to an SSQLS. It may be that SSQLS isn't
flexible enough to deal with a result set coming from multiple tables.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.