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 -> Embedded SQL WHERE clause problem

Embedded SQL WHERE clause problem

From: Jim Morgan <jimmorgan_at_vnet.ibm.com>
Date: 1997/05/27
Message-ID: <01bc6af6$59f94a20$cdf84309@jimmorgan>#1/1

I've been having some difficulty with an embedded SQL application I am writing. The problem is that I keep getting the 'record not found' sqlcode when trying to access the table with the primary key specified on the WHERE clause. The primary key column is defined as CHARACTER 20.

Inserts to the table work fine (no WHERE clause specified) but I cannot retrieve the same row that I inserted into the table with my program when I use a host variable in the WHERE clause. However, if I run SQL*PLUS I can access the row which my application inserted.

My environment is Oracle v7.3.2.3 for AIX using the Pro*C precompiler. I am using the MODE=ANSI and DBMS=V6_CHAR options in my precompiler config file...these are the only deviations I am making from the defaults.

One other important note...if I hard-code the key value in my WHERE clause in my application (instead of using a host variable) I *can* find the row in the table. So I'm definitely having a problem somewhere with host variables. The primary key to the table is defined as CHARACTER 20, and I am using a char[20] host variable in the WHERE clauses giving me trouble. The data I am using to insert to the table consists of non-null terminating character strings (which is why I am not specifying DBMS=V7).

The documentation is unclear and at times contradictory in the sections explaining C character types and the DBMS option. What I want to do is insert keys into the table padded on the right with blanks, and then access the rows with host variables padded the same way. Received on Tue May 27 1997 - 00:00:00 CDT

Original text of this message

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