[Zope] SEQUENCES on SAPDB

Vitor Varalonga vpedrosa@ciberbit.pt
Wed, 11 Sep 2002 13:30:50 +0100


--------------7B9CC3AFEBDC17580CDFEE6F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

    Hi!


    Sorry for the somehow off-topic subject, but the SQL reference doc
I've downloaded from SAPDB website hasn't been that helpful.
    I want to create a auto-incremented primary key on a table.
On SQL Server it's easy since you can set an attribute to
auto-increment.
On Interbase it's not that easy: you have first to create a generator
and then a trigger that will increment that generator on each insertion.

How can I do that on SAPDB?
I suspect it might have something to do with SEQUENCES, so I've just
created one, but now I need to associate it with the primary key.
How can I do it? Using a trigger?
Sorry, but the SAPDB SQL doc is anything but "user-friendly".


thanks,

Vitor Varalonga

--------------7B9CC3AFEBDC17580CDFEE6F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<tt>&nbsp;&nbsp;&nbsp; Hi!</tt>
<br><tt></tt>&nbsp;<tt></tt>
<p><tt>&nbsp;&nbsp;&nbsp; Sorry for the somehow off-topic subject, but
the SQL reference doc</tt>
<br><tt>I've downloaded from SAPDB website hasn't been that helpful.</tt>
<br><tt>&nbsp;&nbsp;&nbsp; I want to create a auto-incremented primary
key on a table.</tt>
<br><tt>On SQL Server it's easy since you can set an attribute to auto-increment.</tt>
<br><tt>On Interbase it's not that easy: you have first to create a generator</tt>
<br><tt>and then a trigger that will increment that generator on each insertion.</tt>
<br><tt>How can I do that on SAPDB?</tt>
<br><tt>I suspect it might have something to do with SEQUENCES, so I've
just</tt>
<br><tt>created one, but now I need to associate it with the primary key.</tt>
<br><tt>How can I do it? Using a trigger?</tt>
<br><tt>Sorry, but the SAPDB SQL doc is anything but "user-friendly".</tt>
<br><tt></tt>&nbsp;<tt></tt>
<p><tt>thanks,</tt><tt></tt>
<p><tt>Vitor Varalonga</tt></html>

--------------7B9CC3AFEBDC17580CDFEE6F--