[I posted this originally on the Zope DB mailing list. I've since edited the
message, and added an update. I've also levt the response I've recieved thus
far appended to the end of the message.]
-------------------------------------------------------
This has me pulling my hairs out... hoping I can get some help...
I'm using MaxDB with Zope 2.6.1 (binary release, python 2.1, win32-x86),
python 2.1.3, win32), ZsapdbDA 0.3 and latest SAPDB Python modules.
I have the following table, populated with a few records in a SAP DB --
create table BANKINFO (
BANKBIC varchar (4) NOT NULL,
BANKNAME varchar (60) NOT NULL,
BANKTYPE varchar (10) NOT NULL,
RAND float NULL,
STRMID smallint NOT NULL,
MD5SUM char (32) NOT NULL,
SHASUM char (40) NOT NULL,
PASSWORD varchar (10) NOT NULL,
FOLDERNM varchar (12) NOT NULL,
primary key ("BANKBIC")
)
All of the queries listed below run without any hiccups in SQL Studio.
The following queries run fine as expected from within Zope and I get the
results I expect -
1. select * from BANKINFO
2. select BANKTYPE from BANKINFO
3. select BANKBIC from BANKINFO
4. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
5. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKTYPE = 'Local' )
6. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKBIC in ('ADCB', 'NBAD') )
The last query gives me 2 records, one for each code, which is the primary
key on the table.
Now for the problem part -- the following queries are failing to return any
records --
1. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKBIC in ('ADCB') )
2. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKBIC = 'ADCB' )
I get the message "There was no data matching this Z sapdb Database
Connection (connected) query." Which I know is not true.
Could someone pleas shed some light on this, or preferably, how I can fix
this in ZSapDB?
Thanks.
Samir.
-----------------------------------------------------
UPDATE (after a response from Dieter Mauer on the Zope List)-
-----------------------------------------------------
I ran the problem queries through a number of tools and I believe the
problem is within the Sapdb module for Python. So Dieter is correct in
saying it's not a Zope issue.
Also, the following queries fail -
1. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKBIC in ('ADCB') )
2. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKBIC = 'ADCB' )
___BUT___ as a workaround, I'm using -
1. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
where ( BANKBIC in ('ADCB', '++++') )
where '++++' can be any dummy non-existent value. And this gives me the
resultset I'm expecting.
I thought I'd post this just in case someone else encounters a similar
problem. I'd prefer a fix though. It took me all day to track down the
problem and only a little less time to find the solution. It's taken up too
much of my time, I just can't spare any more to follow up Dieter's
suggestion, so for now tracing the log is out.
Samir.
-----Original Message-----
From: Dieter Maurer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 22:44
To: Samir Mishra
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope-DB] MaxDB Problems - Pls Help
Samir Mishra wrote at 2004-1-13 08:43 +0400:
> ...
>I'm using MaxDB with Zope 2.6.1 (binary release, python 2.1, win32-x86),
>python 2.1.3, win32), ZsapdbDA 0.3 and latest SAPDB Python modules.
> ...
>6. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
> where ( BANKBIC in ('ADCB', 'NBAD') )
>
>The last query gives me 2 records, one for each code, which is the primary
>key on the table.
>
>
>
>Now for the problem part -- the following queries are failing to return any
>records --
>
>1. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
> where ( BANKBIC in ('ADCB') )
>
>2. select BANKBIC, BANKNAME, BANKTYPE from BANKINFO
> where ( BANKBIC = 'NBAD' )
>
>I get the message "There was no data matching this Z sapdb Database
>Connection (connected) query." Which I know is not true.
For me, it looks as if it were not a Zope issue.
To find out for sure who is responsible, I would
add logging to "ZsapdbDA" (usually the "query" method in "db.py")
to learn what SQL Zope sends to the database and what
the database returns.
--
Dieter
_______________________________________________
Zope-DB mailing list
[EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-db
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]