[Zope] Generating sequence UID?
LD Landis
ldl@LDL.HealthPartners.COM
Wed, 22 Sep 1999 13:57:40 -0500 (CDT)
Hi,
Glad mailman was solid about writing its db, and
Thank goodness that the e-mail system is solid too.
Thanks KenM!
Mail Delivery Subsystem wrote:
> Date: Wed, 22 Sep 1999 11:47:48 -0500
> From: Mail Delivery Subsystem <MAILER-DAEMON@LDL.HealthPartners.COM>
> Subject: Returned mail: unknown mailer error 1
> Message-Id: <199909221647.LAA08215@LDL.HealthPartners.COM>
> To: ldl@LDL.HealthPartners.COM
> ...
> Reason(s) for failure:
> "ldl": Can't write to mailbox
> 554 ldl... unknown mailer error 1
>
Hi,
I have a ZSQL method db_sequence(name) which increments the 'id' of
sequence 'name'... When run ('view') it prompts for the name, and
returns a result that has the title 'id' and the next value. So far so
good.
Now, I want to have another db_contact() method that gets its stuff from
REQUEST, which I have working, but I have been unable to get db_contact()
to call db_sequence('contact_id'). I've tried various syntactic things
and haven't won yet...
The following is not any of the variety of things I've tried, but I hope
suggests what I want:
db_sequence(name) (What I have works, even if not
update sequence set id = id + 1 exactly this)
where name = <dtml-sqlvar name type=string>
db_category(--no parameters--)
insert into category (category_id, name, field...field) values (
<dtml-call db_sequence('category')>,
<dtml-with REQUEST>
<dtml-sqlvar name type=string>,
<dtml-sqlvar ... type=string>,
...
<dtml-sqlvar ... type=string>
</dtml-with>
)
--
Cheers,
--ldl
-----------------------------------------------------------------------------
LD Landis ldl@HealthPartners.Com N0YRQ Voice 612/883-5511 Fax 612/883-6363
HealthPartners, 8100 34th Avenue So, PO Box 1309, Minneapolis, MN 55440-1309
Shape your life not from your memories, but from your hopes. (Borrowed)
-----------------------------------------------------------------------------