[Zope-DB] Re: ZSQL + MySQL + sqltest + list

2006-04-05 Thread Wolfram Kraus

Matthew Fairclough wrote:

Hi,

Really frustrated by this.

dtml-sqltest catId type=int multiple

I want catId to be a list: ie [4, 6, 8].  Examples indicate that I can do this. 
However, ZSQL generates an error every time I put in more than one integer.  How

can I pass a list of integers?

Many thanks.
--
Matthew Fairclough


What is the exact error? Please show us the complete traceback from the 
error.log and the complete ZSQL-Method, please.


Wolfram

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] ZSQL + MySQL + sqltest + list

2006-04-05 Thread Chris Withers

Matthew Fairclough wrote:

Hi,

Really frustrated by this.


No need to tell us twice ;-)


dtml-sqltest catId type=int multiple


type=int is for int's only, you're talking about a list of ints...


I want catId to be a list: ie [4, 6, 8]. 


Hmm, dunno what sqltest does... what are you actually looking to do here?

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] mysql / zope db connection issue

2006-04-05 Thread Chris Withers

Jamie O'Keefe wrote:

try:
  result = context.updatePerson(**query_args)
  return text
except Exception:


This is insane code. If you want to get mailed errors, look at the 
MailingLogger product.




The traceback error is:

Exception Type  Database Error
Exception Value updatePerson is not connected to a database


What version of Zope/MySQL/mysqldb/ZMySQLDA are you using?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] ZSQL + MySQL + sqltest + list

2006-04-05 Thread Matthew Fairclough
Chris,

Thanks for your help.

Basically I just want to limit the result to a number of entries based on Id.

As there are several Id's I'm trying for ... where catId IN (x, y, z).

I could just use a variable that is a list (through REQUEST) but I would like to
ensure the argument is an integer, hence sqltest.

Regards,

Matthew.

Quoting Chris Withers [EMAIL PROTECTED]:

 Matthew Fairclough wrote:
  Hi,
 
  Really frustrated by this.

 No need to tell us twice ;-)

  dtml-sqltest catId type=int multiple

 type=int is for int's only, you're talking about a list of ints...
 
  I want catId to be a list: ie [4, 6, 8].

 Hmm, dunno what sqltest does... what are you actually looking to do here?

 cheers,

 Chris

 --
 Simplistix - Content Management, Zope  Python Consulting
 - http://www.simplistix.co.uk




--
Matthew Fairclough
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] ZSQL + MySQL + sqltest + list

2006-04-05 Thread Charlie Clark

On 2006-04-05 at 10:39:11 [+0200], Matthew Fairclough 
[EMAIL PROTECTED] wrote:
 Chris,
 
 Thanks for your help.
 
 Basically I just want to limit the result to a number of entries based on 
 Id.
 
 As there are several Id's I'm trying for ... where catId IN (x, y, z).
 
 I could just use a variable that is a list (through REQUEST) but I would 
 like to
 ensure the argument is an integer, hence sqltest.

This is one of the reasons why I'm no great fan of dtml-sqltest.

You can easily do your checking for an integer in a PythonScript and pass 
the result into your ZSQL as a standard DTML variable.

catID = [int(i) for i in catIDs]

Cleaner and quicker than playing the dtml-sqltest.

Charlie
-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
  Python/Zope Consulting and Support ...http://www.egenix.com/
  mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
  mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2005-10-17: Released mxODBC.Zope.DA 1.0.9http://zope.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] mysql / zope db connection issue

2006-04-05 Thread Jamie O'Keefe
Hi Chris

On 4/5/06, Chris Withers [EMAIL PROTECTED] wrote:
 Jamie O'Keefe wrote:
  try:
result = context.updatePerson(**query_args)
return text
  except Exception:

 This is insane code. If you want to get mailed errors, look at the
 MailingLogger product.

Did.  What if you don't know what the errors could be?

  The traceback error is:
 
  Exception TypeDatabase Error
  Exception Value   updatePerson is not connected to a database

 What version of Zope/MySQL/mysqldb/ZMySQLDA are you using?

Zope is 2.6.4
MySql is 3.22.32
ZMySQLDA 2.0.8

i don't know the version of mysqldb.

Thanks.

Jamie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] mysql / zope db connection issue

2006-04-05 Thread Jamie O'Keefe
Hi Dieter,

On 4/5/06, Dieter Maurer [EMAIL PROTECTED] wrote:
 Jamie O'Keefe wrote at 2006-4-5 01:32 -0400:
 I have written a series of zope pages for a person to update their
 record in our mysql database.   They use a zpt-python-db sql-db
 driver-db flow and work pretty well.
 
 Unfortunately, if enough people use it, the number of open db
 connections grows until it hits a limit and the db stops accepting
 connections.  I have seen that there is a connection issue with zope
 and mysql, but have not been able to find a solution.  Is there one?

 We are using MySQL and Zope (via ZMySQLDB) and do not see this problem.
 Apparently, Zope handles connections in principle correctly...

What version of MySQL are you using?

One thing I just noticed is that if I connect in via the unix shell
client, quit and login again, the number of connections goes up.  Not
unusual.  In a slow period i will need to see if the number goes down
as well.

Jamie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] mysql / zope db connection issue

2006-04-05 Thread Jamie O'Keefe
  What version of Zope/MySQL/mysqldb/ZMySQLDA are you using?

 Zope is 2.6.4
 MySql is 3.22.32
 ZMySQLDA 2.0.8

 i don't know the version of mysqldb.

I think this is 0.9.

Jamie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db