HELP! Going crazy: OCI bind strange results

HELP! Going crazy: OCI bind strange results

Post by Roger Loe » Sat, 02 May 1998 04:00:00



I have a simple SELECT statement with two input variables, e.g., "SELECT
FROM OURTABLE WHERE ZIP3=:zip3 AND LASTNAME LIKE :surname"

I bind this two variables to input data targets (of the appropriate length)
and execute the statement.  I get no rows back.  If I hard code the
statement with the SAME data, e.g., SELECT FROM OURTABLE WHERE ZIP3=731 AND
LASTNAME LIKE 'LAB%'" (that's a single quote, then a double quote), then I
get 400 rows back.

I know the bind is working because I can see the bind data in the TRACE
file.

I've been fighting this for two days, and I'm going crazy (crazier?)  Any
ideas gratefully accepted.

Rog

--

 
 
 

HELP! Going crazy: OCI bind strange results

Post by Roger Loe » Sat, 02 May 1998 04:00:00


Oops, forgot  to mention, Oracle 8.03 on NT.

 
 
 

HELP! Going crazy: OCI bind strange results

Post by Jagdish Raj » Mon, 04 May 1998 04:00:00


Rog,
What are your bind datatypes? I'm pretty sure :surname is a SQLT_CHR
but what is :zip3?  With the SQLT_CHR you must specify the correct
size of the host variable for the comparison to be correct - this
should not include any null bytes if they are present in your host
variable being bound.

Jagdish



>I have a simple SELECT statement with two input variables, e.g., "SELECT
>FROM OURTABLE WHERE ZIP3=:zip3 AND LASTNAME LIKE :surname"

>I bind this two variables to input data targets (of the appropriate length)
>and execute the statement.  I get no rows back.  If I hard code the
>statement with the SAME data, e.g., SELECT FROM OURTABLE WHERE ZIP3=731 AND
>LASTNAME LIKE 'LAB%'" (that's a single quote, then a double quote), then I
>get 400 rows back.

>I know the bind is working because I can see the bind data in the TRACE
>file.

>I've been fighting this for two days, and I'm going crazy (crazier?)  Any
>ideas gratefully accepted.

>Rog

>--


 
 
 

HELP! Going crazy: OCI bind strange results

Post by Roger Loe » Mon, 04 May 1998 04:00:00


Jagdish,

The bind datatypes and lengths are (were) correct.  I fixed this by filling
the field (to the correct length) with '_'  (underline), rather than using
'%'

Thanks for your suggestion; it caused me to look at the problem differently.

Rog

 
 
 

1. Linked Servers Help I am going crazy

I have a need to link an MSAccess database (which has workgroup security) to
SQL Server 7. I am using the following:

EXEC sp_addlinkedserver




Source=\\FMTBF050\Gms\GMiSd.mdb;Jet OLEDB:System
Database=\\FMTBF050\Gms\Gms3.mdw;Mode=Share Deny None'

This adds the linked server but it is unusable, a query against it (works if
mdb is unsecured) gives me:

Server: Msg 7303, Level 16, State 2, Line 1
Could not initialize data source object of OLE DB provider
'Microsoft.Jet.OLEDB.4.0'.
[OLE/DB provider returned message: Cannot start your application. The
workgroup information file is missing or opened exclusively by another
user.]

The "provstr" will work using an ADO connection with Visual Basic

Does anyone know how to do this I am going crazy??

Mike O'Ceirin

2. Table

3. Please help, I'm going crazy

4. Sorting Large table, small select set

5. Cursor gone crazy!!! Help

6. SQL Server and Backup.

7. HELP : I'm going crazy CORRUPTIONS CORRUPTIONS

8. Credit card interface with VFP

9. Help!!! mdac2.6 gone crazy

10. Going crazy !!! Help please

11. ** HELP WITH vb 4.0 I am going crazy**

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

13. Insert gone crazy