[Zope] [newbie] Z SQL methods ...help!?

Jim Sanford jsanford@atinucleus.com
Sun, 21 Nov 1999 08:22:59 -0600


Assuming you have a folder property called number that has the course ID in
it,
 the following DTML document in your folder should work: (greatly
simplified)

<html><body><table>
<tr><th>Course ID</th><th>Course Title</th></tr>
<!--#in name_of_ZSQL_query-->
<tr><td><!--#var number--></td><td><!--#var title null=''--></td></tr>
<!--#/in-->
</table></body></html>
 __________________________________________________________________

              Jim Sanford
      .       Database Engineer
     / \  /   Accelerated Technology, Inc.
    /   /     720 Oak Circle Drive East
   /  /  \    Mobile, AL 36609
  / /     \   Voice: 334-661-5770  fax: 334-661-5788
 /         \  E-Mail: jsanford@atinucleus.com
              Web: http://www.atinucleus.com

 Source Code, No Royalties, Any CPU...It just make sense !
 __________________________________________________________________


----- Original Message -----
From: Darcy Clark <darcyc@engin.umich.edu>
To: <zope@zope.org>
Sent: Saturday, November 20, 1999 2:32 PM
Subject: [Zope] [newbie] Z SQL methods ...help!?


> I am a Zope newbie working my way through the Z SQL Methods user guide (
> http://www.zope.org/Documentation/Guides/ZSQL ) .... I made a simple
> MySQL database, setup a connection to it, made a Z SQL method to access
> my database ....then I  used the Search interface creation wizard to
> create a query form and a report page. I tested it and it works great
>
> My question has to do with alternative ways of accessing SQL data, other
> than by going through a html query form.
>
> Obviously one way to do it is to 'encode' the query into a URL - e.g.
>
http://darcy.engin.umich.edu:8080/Plutonia/MySQL_test/course_report?number=m
se242
>
> My question is as follows :
>
> my MySQL table contains 2 fields : number and title
>
> example data :
>
> number    title
> mse242    physics of materials
> mse252    principles of engineering materials
>
> I want to build a folder containing a Z SQL method - this folder has a
> Property of 'course=mse242'. In this folder I have a page (DTML-method?)
> that when accessed via the browser, will *automatically*  access the Z
> SQL method, run a query based on the property 'course=mse242' and spit
> out a page containing the number (mse242) and the title (physics of
> materials).
>
> What I want to get around is having to access a html query form to get
> to a particular course....I want to store the course name in a folder's
> properties and access this property automatically when I render any
> pages in that folder. Can this be done ? Can my Z-SQL methods access
> folder properties and then run queries on this basis ? If this is
> possible can you refer me to any docs that address this ?
>
> here is my current Z SQL method :
>
> select *
> from courses
> where
> <!--#sqltest number
>  column=number type=string-->
>
> I guess what I am shooting for here is to utilize acquisition within Z
> SQL methods....I would not be surprised if I missing something *really*
> basic here ....  curse my newbieness!!   :).
>
> thanks in advance for any advice.
>
> Darcy
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
>           No cross posts or HTML encoding!
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>