Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: ORA-00933 Error Post Reply Post New Topic
Author Message
Tycanis
Newbie
Newbie


Joined: 18 Jul 2011
Location: United States
Online Status: Offline
Posts: 11
Quote Tycanis Replybullet Topic: ORA-00933 Error
     Posted: 14 Feb 2013 at 10:59am
I am trying to create a command for a union of two tables.
 
Without the Where clauses it works but it takes forever to process a reports because there are over a millions records in each table.  I left out the names of the tables for privacy.
 
Any ideas or alternatives?
 

 

SELECT SCAN_CREATE_TM,

SCAN_CREATE_DT,

Null as PROCESS_IORG_NBR,

SCAN_IORG_NBR,

Null as SCAN_TYPE_CODE,

USER_ID,

Null as SCAN_USER

 FROM   hidden

WHERE  (SCAN_CREATE_DT>=SYSDATE AND SCAN_CREATE_DT<SYSDATE-7)

 

UNION ALL

 

SELECT SCAN_CREATE_TM,

SCAN_CREATE_DT,

PROCESS_IORG_NBR,

Null as SCAN_IORG_NMB,

SCAN_TYPE_CODE,

Null as USER_ID,

SCAN_USER

 FROM   hidden

WHERE  SCAN_TYPE_CODE='I' AND SCAN_CREATE_DT>=SYSDATE AND SCAN_CREATE_DT<SYSDATE-7)
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Feb 2013 at 11:54am
This is an Oracle error code.  A quick Google search tells me that this means:  ORA-00933: SQL command not properly ended. 
 
A quick look at what you've entered, if you just did a straight copy and paste into the forum, you're missing a parenthesis -
 
WHERE (SCAN_TYPE_CODE='I' AND SCAN_CREATE_DT>=SYSDATE AND SCAN_CREATE_DT<SYSDATE-7)
-Dell
IP IP Logged
Tycanis
Newbie
Newbie


Joined: 18 Jul 2011
Location: United States
Online Status: Offline
Posts: 11
Quote Tycanis Replybullet Posted: 14 Feb 2013 at 12:37pm
Thanks.  Probably did not help that I was trying to figure this out while caring for my 3 month old.  I should have caught that but thanks a lot.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum