OCI Bind/ SQL Select problem, Oracle8

OCI Bind/ SQL Select problem, Oracle8

Post by Roger Loe » Tue, 17 Mar 1998 04:00:00



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
--

 
 
 

1. OCI - placeholders and BIND to INSERT & SELECT

Hello
Im using OCI to access ORACLE database from a c program.
Im using INSERT and SELECT of the same columns in the table.
Both INSERT and SELECT use placeholders.
My questions are :
1)Does any placeholder need to use the OCIBind ?
2)If the INSERT and SELECT use the same placeholder (e.g.
  :ename) does ename has to do the OCIBind twice for the
  INSERT and for the SELECT ?
3)What OCIBind has to be used - OCIBindByPos() or
  OCIBindByName ?
4)What is the Bind input / Bind output ? what is their
  usage ? Is it neccessary to use them and How do I use
  them.
Please give me a full answer whith an example.
Thank you.
uri

2. Massive Insertion of data into a table

3. OCI: binding arrays in select statements?

4. Select Into Temporary Table

5. bind variables in OCI select

6. progress bar

7. OCI: Binding collections (varray), Ora 1008: not all variables bound

8. VB to SQL via ODBC dropping connection at random

9. Problem compiling oracle8 oci with gcc / Aix

10. Oracle8 for Linux OCI link problem

11. Problem writing to VARRAY columns (Oracle8 OCI)

12. BIZARRE problem with OCI array bind, insert