Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Very strange behaviour of SQL under OCI

Re: Very strange behaviour of SQL under OCI

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 01 Apr 1999 13:53:45 GMT
Message-ID: <370b7a5d.7377608@192.86.155.100>


A copy of this was sent to "Grzesiek" <grzesiek_at_no.spam> (if that email address didn't require changing) On Thu, 01 Apr 1999 11:55:32 GMT, you wrote:

Lets see the code.

>Hi everyone,
>I have a problem with SQL statment excuted with OCI. I'm using ORACLE 8.0.3
>under OpenVMS 7.1-1H2
>and old OCI (from version 7.3.2 - oexec, ofen, etc...) compiled with new
>libraries.
>Under SQLPLUS statments results are always correct.
>
>Consider my statment:
>
>SELECT kod_odm FROM tx;
>
>Table tx contains over 3000 records, but under OCI I've got only 1.
>
>Next statment is:
>
>SELECT kod_odm FROM tx WHERE kod_odm IS NOT NULL;
>
>This time I've got correct results (940 records).
>
>Next statment is:
>
>SELECT kod_odm FROM tx WHERE kod_odm IS NOT NULL OR kod_odm IS NULL;
>
>Again, I've received only one record.
>
>This is execution plan of the last statment below:
>--------------------
>SELECT kod_odm
>FROM
> tx where kod_odm is not null or kod_odm is null
>
>
>call count cpu elapsed disk query current
>rows
>------- ------ -------- ---------- ---------- ---------- ---------- ------
>----
>Parse 1 0.00 0.01 0 0 0
>0
>Execute 1 0.00 0.00 0 0 0
>0
>Fetch 1 0.00 0.00 5 1 3
>0
>------- ------ -------- ---------- ---------- ---------- ---------- ------
>----
>total 3 0.00 0.01 5 1 3
>0
>
>Misses in library cache during parse: 1
>Optimizer goal: RULE
>Parsing user id: 18 (PZ)
>
>Rows Execution Plan
>------- ---------------------------------------------------
> 0 SELECT STATEMENT GOAL: RULE
> 1 TABLE ACCESS GOAL: ANALYZED (FULL) OF 'TRANSAKCJE'
>
>-------------------------
>
>Results for every other column selected from table tx are correct.
>
>Does anybody know the reson of this strange OCI behaviour?
>
>TIA
>
>Grzesiek
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Apr 01 1999 - 07:53:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US