oracle


Oracle error 923 when selecting hardcoded values for some columns in UNION ALL


I am facing oracle error 00923 while trying to retrieve hard coded values ('') in one of the sub-query that is a part of UNION ALL query.
select p.owner,
p.exception_id,
p.status,
p.product_id,
p.event_id
from exception p, exception c
where c.Parent_Id = p.Exception_Id
AND c.Owner_COID = p.Owner_COID
UNION ALL
select p.owner,
p.exception_id,
p.status,
'',
''
from exception p
and not exists (select * from bb_Exception c
WHERE c.Parent_Id = p.Exception_Id);
Could some one please help me resolve the issue?.
Thanks
No WHERE clause in the second half of the UNION ALL !
from exception p
and not exists (select * from b
should be
from exception p
where not exists (select * from b
Once you fix that, if p.product_id or p.event_id are numeric (as might be expected with IDs) then you should get this exception:
ORA-01790: expression must have same datatype as corresponding expression
The solution in to use null rather than empty string. Oracle treats them as equivalent but '' is a varchar2 datatype and null is not.

Related Links

Oracle SQL to bring back results not in
Oracle: Determine Partition Size
How to determine the most efficient index range size to grab?
Use Cursor variable to insert with a loop in a store procedure
Using a Variable in a Table Creation Script
Accessor is not a parameter accessor
Oracle Apex Execution of Page Process
case when oracle BI
Insert Entry and Ignore Sequence
SSIS converts Varchar2 to DT_STR
oracle to_char daylight savings
Oracle: How to find in a tree
java timestamp with timezone to store in ORACLE DB
Schedule a job on specific dates using DBMS_JOB
Oracle : Stored procedure how to to_char expression in string variable
How to set up a database link in Oracle?

Categories

HOME
elasticsearch
events
angular-ui-grid
barcode-scanner
selenium-builder
kivy
hdfs
ontology
repair
anchor
siesta
lda
fasm
cqrs
csrf
chromecast
amazon-elb
async-await
rest-assured
spyder
el
multi-upload
software-packaging
mod-wsgi
dragula
web-push
raima
msdeploy
tortoisehg
bonita
cube
publishing
rust-cargo
lxml
overwrite
cmis
grails-2.5
subclassing
assertions
cordys-opentext
eclipse-gmf
iscroll
assemblies
grunt-contrib-watch
oauth2-playground
distributed-caching
flipkart
web-inspector
virtual-memory
julius-speech
morphline
zend-form
nothing
knockout-2.0
head.js
sonatype
network-protocols
sidewaffle
instafeedjs
email-injection
petsc
pjax
metabase
jsf-2.3
yii2-model
wicked-pdf
highlighting
gulp-uglify
msgpack
cfwheels
sqlbase
artisan
jcheckbox
dos2unix
fasterxml
flurry-analytics
zend-mail
nesper
tabris
relationships
lumia-imaging-sdk
code-complexity
principalcontext
autonumber
stty
quickgraph
xcode4.5
android-dialog
voice-recording
jdom
image-scanner
firebird1.5
liveconnect
quartz-core
yuidoc
winsxs
startupscript
cewolf
fragment-identifier
3des
suphp
android-2.1-eclair
jdownloader
ninject-interception
icicles
.net-services

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile