[Zope] sql returning number
Kamal Gill
ksgill at ucdavis.edu
Thu Sep 25 16:33:20 EDT 2003
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:
> 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…
>
>
>
> select MAX(ID)+1 from AllProjects
>
>
>
> This gives the expected:
>
>
>
<image.tiff>
>
>
>
>
> 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.
>
>
>
> <dtml-in getNewProjectID>
>
> Here’s the ID: <dtml-var ID>
>
> </dtml-in>
>
>
>
> but it keeps giving me a‘KeyError” – “ID”
>
> of course, lowercase id just shows the name of the folder that the
> dtml document is in.
>
> So, does anyone know how I can put that result into my webpage?
>
>
>
> Thanks,
>
> Derek S. Wilson
>
>
>
>
>
> *****HIPAA Confidentiality Notice*****
> 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.
>
>
>
> <Derek S. Wilson.vcf>_______________________________________________
> Zope maillist - Zope at 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 )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3836 bytes
Desc: not available
Url : http://lists.zope.org/pipermail/zope/attachments/20030925/a5647cb8/attachment.bin
More information about the Zope
mailing list