Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> string functions returning garbage
Oracle 8.1.6.3.0 on unix. Problem duplicated on 8.1.7/Windows 2k
(exp/imp
tables)
One of our developers sent me the following query, saying that it
resulted
in an "invalid number" error. To summarize, the string functions are
sometimes returning garbage (pointer problem?). Before I hand it to tech
support I thought it was interesting enough to share with the group.
Also
thought someone might know of a bug or see something obviously wrong in
the
query - though I would assume if the latter Oracle would have a more
polite
way of expressing it.
select planet,id1, substr(upleft,4,3), substr(lwrrit,4,3), substr(upleft,1,3), substr(lwrrit,1,3)
to_number(ltrim(substr(lwrrit,4,3))) <= -45) and
I verified the invalid number result, and using Embarcadero's DBArtisan
was able to get a
little more info (when the result didn't cause it to crash)
Garbage result (varies but this is typical):
Planet id1
upleft 4 3 lwrrit 4 3 upleft 13 lwrrit 1 3 Production PxP PxP PxP
After commenting out clauses from subquery to second (to_number)
condition
the query gets sensible results. Once that has happened I uncomment
everything and the query works:
Moon 868 -42 -45 016 007
Although I didn't see anything strange in the tables, I ran dbverify
which
came up clean.
Here are the table structures:
MAP -
CENTR Y VARCHAR2 6 DATENT Y VARCHAR2 10 FRC Y VARCHAR2 2 ID1 Y NUMBER 7 7 0 ID1MAP Y VARCHAR2 12 LASTUP Y VARCHAR2 10 LWRLFT Y VARCHAR2 6 LWRRIT Y VARCHAR2 6 MAPTYP Y VARCHAR2 4 PLANET Y VARCHAR2 10 PUBYR Y VARCHAR2 2 QUANTY Y NUMBER 6 6 0 SCALE Y VARCHAR2 4 SOURCE Y VARCHAR2 4 TITLE Y VARCHAR2 30 UPLEFT Y VARCHAR2 6 UPRITE Y VARCHAR2 6 AREA N VARCHAR2 13 ID1 N NUMBER 7 7 0 ID1MAP N VARCHAR2 12 QUANTY Y NUMBER 4 4 0 SITE N VARCHAR2 4
I think the Planet Oracle and its connection with the Enterprise is a clue also, but just can't decide what it means...
fdp
"Toulouse was too loose; he had to lose"
![]() |
![]() |