Re: [Modeling-users] No semicolons in SQL
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-11-11 22:31:16
|
<luk...@po...> writes: > Hi >=20 > First, thanks to you Sebastien for quick and precise response about > "fetchSQL". >=20 > And I've got another problem: > Why there are no semicolons after every SQL expression generated by > mdl_generate_DB_schema.py? In "quick overview" example they are. I use > PostgreSQL and there the semicolons are required. After few recreations of > my database queries I'm tired with manually inserting this characters. As= I > remember Oracle also requires them ( but MySQL doesn't). [...] Okay, there's two things, in fact. The generated SQL statements are w/o any semi-colons. Now you make me notice that there is a problem on the "quick overview" page: the line that says: << Or create the database directly: shell> mdl_generate_DB_schema.py -c -C \ --admin-dsn=3D"localhost:template1:postgres:" sample_pymodel.py >> Should say: << shell> mdl_generate_DB_schema.py -C \ --admin-dsn=3D"localhost:template1:postgres:" sample_pymodel.py >> --> without the '-c' (=3D=3D --stdout), this command issues the sql statements directly to the db, without you having to copy-paste them within the db cmdline (I've just corrected that, thanks). That's why it needs the --admin-dsn option. > I generate sql with mdl_generate_DB_schema.py and I don't get semicolons.= Is > it caused by my shortage of knowledge how to get the semicolons or it is > some author's oversight? If it is my fault please give me some piece of > advice. Else maybe in the future releases some additional parameter to the > mdl_generate_DB_schema.py script could be added? For example: > mdl_generate_DB_schema.py -m > With -m the sql expressions would be generated with semicolons at the end, > else and default - without them. That's definitely not a lack of knowledge. In fact, this was reported one+ month ago by Erny, check this thread: https://sourceforge.net/mailarchive/forum.php?thread_id=3D3140798&forum_id= =3D10674 (this discussion also exposes some other reasons why there is no semi-colon after sql statements generated by the framework). You'll find the related patch at: https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D812708&group_= id=3D58935&atid=3D489338 With this patch, the sql statements generated by the script 'mdl_generate_DB_schema.py -c' have a semi-colon at their end by default. Use option -e/--end-with to change that. Now you now why I want to make a release in the coming days: I've been ''distracted'' too long ;) BTW: I *never* close a bug ticket or a RFE before the correction/patch is integrated in a released version, so you'll always be able to find the latest fix on the bugs- & RFE- pages without having to use CVS. This is probably something I should write somewhere in clear... > SB> I'll also be pleased to hear from your own > SB> application, at least of the aggregations you're thinking about when > SB> asking this (if you can disclose): it always help to learn about the > SB> context in which feature requests raises. >=20 > Of course. Actually I'm learning Modeling Framework and trying to use it = in > my application (bussines-portal in Zope(Plone)). As you see I've got many > problems with it :-) After the scheme of the database and queries will ha= ve > been completed I'll send you some description and 'aggregaton queries from > the real life' (I think that I'll do it outside the mailing list) That's fine, I can wait until then! However, do I understand you right that you're about to test integration of MDL within plone products, right? I've not played w/ Plone for a while, and I'm quite interested in hearing from problems and progress in general. Maybe this could be a good start for a tutorial, so if you're willing to and have some time maybe we could collaborate on such a tutorial --just let me know. -- S=E9bastien. |