zope sql_delimiter windows
I have a Zope application that runs perfectly on Linux. However, my target audience is likely to use Windows so I am trying to port my app. to that platform. Whenever I use a multiple insert Zsql method that includes sql_delimiter, python.exe crashes. eg. <dtml-in att> <dtml-var sql_delimiter> <dtml-if absent> insert into attendance (absent,timeperiod,studentid ) values ( <dtml-sqlvar absent type="string">, <dtml-sqlvar timeperiod type="string">, <dtml-sqlvar studentid type="int"> ) </dtml-if> </dtml-in> The above ZSQL method works on Linux any Zope version but causes the crash on Windows, Zope versions - 2.8, 2.9, 2.10 have been tested and all fail, is there an issue with this? Regards Garry
Does run your multiple INSERT queries at Database Adapter Test tab? JL. ----- Original Message ----- From: "garry saddington" <garry@schoolteachers.co.uk>
I have a Zope application that runs perfectly on Linux. However, my target audience is likely to use Windows so I am trying to port my app. to that platform. Whenever I use a multiple insert Zsql method that includes sql_delimiter, python.exe crashes.
On Sat, 2006-12-23 at 23:39 +0100, Jaroslav Lukesh wrote:
Does run your multiple INSERT queries at Database Adapter Test tab?
None of them run (and I have many) from the test tab as I collect the data from a web form using the :records structure. Regards Garry
ANd SQL database is the same type and version or not? ----- Original Message ----- From: "garry saddington" <garry@schoolteachers.co.uk>
On Sat, 2006-12-23 at 23:39 +0100, Jaroslav Lukesh wrote:
Does run your multiple INSERT queries at Database Adapter Test tab?
None of them run (and I have many) from the test tab as I collect
the data from a web form using the :records structure. Regards Garry
garry saddington wrote at 2006-12-23 22:26 +0000:
I have a Zope application that runs perfectly on Linux. However, my target audience is likely to use Windows so I am trying to port my app. to that platform. Whenever I use a multiple insert Zsql method that includes sql_delimiter, python.exe crashes.
There is no issue with "sql_delimiter" on Windows. In fact, "sql_delimiter" is extremely harmless: it just inserts a delimiter (usually the "\0" character) used to break the complete generated SQL into a sequence of SQL commands sent to the database. This happens in "...db.DB.query". It is completely platform independent.
eg. <dtml-in att> <dtml-var sql_delimiter>
You Windows database client library may not like empty SQL commands (while the Linux library might be more resilient). Try to suppress the first "sql_delimiter" (as it creates an empty SQL command). -- Dieter
On Sun, 2006-12-24 at 21:00 +0100, Dieter Maurer wrote:
garry saddington wrote at 2006-12-23 22:26 +0000:
I have a Zope application that runs perfectly on Linux. However, my target audience is likely to use Windows so I am trying to port my app. to that platform. Whenever I use a multiple insert Zsql method that includes sql_delimiter, python.exe crashes.
There is no issue with "sql_delimiter" on Windows.
You are correct, after some pointers from the list, I chased down the problem to the psycopg2 adapter. After downgrading to the last stable version in the 1 series the problem has gone away. Thanks to all who offered help. Regards Garry
participants (3)
-
Dieter Maurer -
garry saddington -
Jaroslav Lukesh