Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Aug 16, 2017 10:06 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Union in RealSQLDatabase broken in new version
PostPosted: Sun Apr 21, 2013 12:21 am 
Offline

Joined: Fri Jun 02, 2006 1:43 pm
Posts: 209
Location: Santa Ynez, CA
I have been updating a program I wrote three years ago and using the 2012R2.1. A query with a UNION previously returned two records in the recordset, but not only returns one. My SQLManager for Windows, admittedly two years old, returns two records. Do I have to dig out an old version of RB or is there a newer syntax for using Unions? Or is this a bug in Real Studio?


Top
 Profile  
Reply with quote  
 Post subject: Re: Union in RealSQLDatabase broken in new version
PostPosted: Sun Apr 21, 2013 8:37 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Doubt it is a bug in Real Studio.... since SQLite is an engine of its own and simply responds to SQL commands passed to it.

I'd check the syntax of your Union with the latest SQLlite documents (can be found on the Sqlite website)
or post them here for a review by your peers.

Have you tried executing each side of the UNION by itself to see what is returned? I am assuming by your statement that you are expecting the top portion to be returning one record, and the bottom portion to return the other? Check to insure that each works indepentantly first.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Union in RealSQLDatabase broken in new version
PostPosted: Sun Apr 21, 2013 9:07 am 
Offline

Joined: Fri Jun 02, 2006 1:43 pm
Posts: 209
Location: Santa Ynez, CA
Thanks Dave. You're right. The new syntax has changed in the new version of SQLite. UNION returns the first part of the query and UNION ALL returns both.


Top
 Profile  
Reply with quote  
 Post subject: Re: Union in RealSQLDatabase broken in new version
PostPosted: Sun Apr 21, 2013 9:13 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
The diff between UNION and UNION ALL

is that "UNION" also removed duplicates (ie DISTINCT), while UNION ALL does not remove them

Never noticed with SQLite, but that is how ORACLE has worked for years

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group