Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
SQL##f - SqlState: S1000, ErrorCode: 920, ErrorMsg: [Oracle][ODBC][Ora]ORA-00920: invalid relational operator
SQL SELECT
corekey AS "corekey",
coreid AS "coreid",
coreconst AS "coreconst",
corebrthyr AS "corebrthyr",
corebrthmn AS "corebrthmn",
corebrthdy AS "corebrthdy",
coreprefyr AS "coreprefyr",
coreprfsch AS "coreprfsch"
FROM corebio_full
WHERE not exists (select attrid,attrtype from attribute_full where attrid = coreid and attrtype in ('dnm','dnc','BOT','FBoD'))
AND not exists (select deathid from death_full where deathid = coreid)
AND not exists (select phnid,phnnumber from phone_full where phnid = coreid and isnull(phnnumber))
I am trying to get rid of any records that do not have a phone number
From a syntax point of view I think isnull doesn't exist in Oracle
Try with NVL
EXISTS is neither a valid syntax in SQL
Script may work with preceding load (where then the QV-commands are available):
LOAD
corekey AS "corekey",
coreid AS "coreid",
coreconst AS "coreconst",
corebrthyr AS "corebrthyr",
corebrthmn AS "corebrthmn",
corebrthdy AS "corebrthdy",
coreprefyr AS "coreprefyr",
coreprfsch AS "coreprfsch"
WHERE not exists (select attrid,attrtype from attribute_full where attrid = coreid and attrtype in ('dnm','dnc','BOT','FBoD'))
AND not exists (select deathid from death_full where deathid = coreid)
AND not exists (select phnid,phnnumber from phone_full where phnid = coreid and isnull(phnnumber));
SQL SELECT * FROM ....
HTH Peter
Tammy - I am with Massimo. Please try NVL.
exists (<subquery>)
and
not exists (<subquery>)
is a valid Oracle (and sql) syntax
@ Massimo: you are correct, did not read the syntax carefully enough
Peter