[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Relational Database Connectivity

webmaster at zope.org webmaster at zope.org
Wed Feb 18 14:38:44 EST 2004


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/RelationalDatabases.stx#3-68

---------------

      Suppose each department folder has a *department_id* string
      property that identifies the accounting ledger id for that
      department. This property could be used by a shared Z SQL Method to
      query information for just that department.  To illustrate,
      create various nested folders with different *department_id*
      string properties and then create a Z SQL Method with the id
      *requisition_something* in the root folder that takes three
      arguments, *description*, *quantity*, and *unit_cost*. and the
      following query template::

        INSERT INTO requisitions 
          (
            department_id, description, quantity, unit_cost
          )
        VALUES
          (
            <dtml-sqlvar department_id type=string>,
            <dtml-sqlvar description type=string>,
            <dtml-sqlvar quantity type=int>,
            <dtml-sqlvar unit_cost type=float>
          )

        % Anonymous User - Feb. 18, 2004 2:38 pm:
         I had to add the department_id to the requisition_something Z SQL Method in order to get it to test properly.
         Then the rest of the example worked out just fine.



More information about the ZDP mailing list