Have you tried..

  select MAX(ID)+1 as ID from AllProjects

?


 - kg

 

On Thursday, September 25, 2003, at 01:14  PM, Derek S. Wilson wrote:


<excerpt><fontfamily><param>Arial</param><smaller>I have a slight
problem… I’m working on a project management zope site, and I need to
create a new sequential project ID for each project. I made a zsql
statement as follows…</smaller></fontfamily>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


<fixed><fontfamily><param>Courier New</param><smaller>select MAX(ID)+1
from AllProjects</smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><smaller> </smaller></fontfamily></fixed>


<fontfamily><param>Arial</param><smaller>This gives the expected:</smaller></fontfamily>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


</excerpt><<image.tiff>

<excerpt>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


<fontfamily><param>Arial</param><smaller>I now want to take that
value(3) and use it as my ID. The column name is ID, So, here’s how I
go about doing it.</smaller></fontfamily>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


<fixed><fontfamily><param>Courier New</param><smaller><<dtml-in
getNewProjectID></smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><smaller>Here’s the ID:
<<dtml-var ID></smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><smaller><</dtml-in></smaller></fontfamily></fixed>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


<fontfamily><param>Arial</param><smaller>but it keeps giving me
a</smaller></fontfamily><fixed><fontfamily><param>Courier New</param><smaller>‘KeyError”
– “ID”</smaller></fontfamily></fixed>


<fontfamily><param>Arial</param><smaller>of course, lowercase id just
shows the name of the folder that the dtml document is in.</smaller></fontfamily>


<fontfamily><param>Arial</param><smaller>So, does anyone know how I
can put that result into my webpage?</smaller></fontfamily>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


<fontfamily><param>Arial</param><smaller>Thanks,</smaller></fontfamily>


<fontfamily><param>Arial</param><smaller>Derek S. Wilson</smaller></fontfamily>


<fixed><fontfamily><param>Courier New</param><smaller> </smaller></fontfamily></fixed>


<fontfamily><param>Arial</param><smaller> </smaller></fontfamily>


<bold><fontfamily><param>Arial</param><smaller>*****HIPAA
Confidentiality Notice*****

</smaller></fontfamily></bold><fontfamily><param>Verdana</param><smaller>The
documents inside this electronic transmission contain confidential
information belonging to the sender that is legally privileged. This
information is intended only for the use of the individual or entity
named above. The authorized recipient of this information is
prohibited from disclosing this information to any other party and is
required to destroy the information after its stated need has been
fulfilled, unless otherwise required by law. If you are not the
intended recipient, you are hereby notified that any disclosure,
copying, distribution, or action taken in reliance on the contents of
these documents is strictly prohibited. If you received this
electronic transmission in error, please notify the sender immediately
to arrange for
return</smaller></fontfamily><fontfamily><param>Arial</param><smaller>.</smaller></fontfamily>


<fontfamily><param>Times New Roman</param> </fontfamily>


<<Derek S. Wilson.vcf>_______________________________________________

Zope maillist  -  Zope@zope.org

http://mail.zope.org/mailman/listinfo/zope

**   No cross posts or HTML encoding!  **

(Related lists - 

 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )

</excerpt>