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

Home -> Community -> Usenet -> c.d.o.misc -> OCI Bind/ SQL Select problem, Oracle8

OCI Bind/ SQL Select problem, Oracle8

From: Roger Loeb <rloeb_at_martech.com>
Date: 1998/03/16
Message-ID: <6ejon3$cbl$1@news1.rmi.net>#1/1

Need to suggestions re a strange problem I'm having in a program using OCI calls to an Oracle 8 database.

The SQL statement looks something like this --

SELECT * FROM ADDRESS_TABLE WHERE ZIPCODE=:Zipcode AND SOUNDEX_STREET_NAME=:Street AND HOUSE_NUMBER LIKE :House

All three of the columns are defined in the table as char(), not varchar(), because leading and trailing spaces are significant.

The target :Zipcode is a 5-byte field, bound to the variable with a length of 5, and containing a five-digit Zipcode. The column in the database is also 5 characters.

The target for :Street is an 8-byte field, bound to the variable with a length of 8; the data in that field consists of a 4-byte Soundex string and 4 spaces. The column in the database is char(8) and the field is space filled.

The target for "House is a 6 byte field, bound to the variable with a length of 5, and containing something like " 25%". The column in the database is char(6). [The purpose of this statement is to find all of the addresses in a specific Zipcode, on a specific street, and in a specific block, i.e., the last two digits of the house number have been truncated and replaced by a single %.]

When executed directly from SQL Worksheet, with single quotes surrounding the data values, the statement works as planned. When executed from the OCI call library, the statement returns NO_DATA. [The call library interface works; if I truncate the statement to just the Zipcode part, everything works fine, but returns rather a lot of records.]

Ideas???

TIA, Rog

--
roger@_delete_this_to_reply_.martech.com
Received on Mon Mar 16 1998 - 00:00:00 CST

Original text of this message

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