Menu

#3 gen_id() wrapper needed

closed
nobody
None
5
2002-08-20
2002-05-24
No

I like to see a python wrapper to gen_id() function,
becouse i don't want to write a before insert trigger.

Now i can use GNUe forms triggers (in client side),
and remain db independent. But only with this trick:

select gen_id() from rdb$database

in GNUe interbase driver.

Bajusz Tamás

Discussion

  • David S. Rushby

    David S. Rushby - 2002-06-10

    Logged In: YES
    user_id=414645

    I don't know of any way to manipulate generators with the
    Interbase C API. I think it must be done using SQL
    statements (statements that reference the gen_id function,
    the SET GENERATOR statement, or the RDB$GENERATORS system
    table). Is that correct?

    If so, what you're suggesting is that a wrapper around the
    "select gen_id(generator_name, increment_value) from
    rdb$database" be added as a method of
    kinterbasdb.Connection, correct?

     
  • Bajusz Tamás

    Bajusz Tamás - 2002-06-10

    Logged In: YES
    user_id=473527

    No. If there is no way with C API, i don't see any benefit
    of a wrapper.

    Maybe this (and a missing rowcount support) would be a
    feature request to firebird team.
    What do you think?

     
  • David S. Rushby

    David S. Rushby - 2002-06-14

    Logged In: YES
    user_id=414645

    > No. If there is no way with C API, i don't see any benefit
    of a
    > wrapper.

    I also don't see much benefit. It would, however, be
    possible to add a SQL-based "wrapper" and simply transition
    it to API-based in the future if API facilities for
    manipulating cursors become available.

    > Maybe this (and a missing rowcount support) would be
    > a feature request to firebird team. What do you think?

    Both would be nice, but as for the generator stuff,
    they'll probably just tell you to use SQL.

    There's probably some good reason why their engine doesn't
    offer rowcount support already, but it certainly would be
    nice to have.

    Another feature on my personal wish list is a
    XSQLVAR.sqlprecision field to go along with
    XSQLVAR.sqlscale. The
    query-the-system-tables-and-cache-the-results crap that I've
    gone through with CVS revisions 1.25-1.29 of _kinterbasdb.c
    should not have been necessary.

     
  • David S. Rushby

    David S. Rushby - 2002-08-20

    Logged In: YES
    user_id=414645

    I've taken another look at the IB API documentation, and
    it's clear that it does not have any generator manipulation
    functions, so I'll reject this feature request.

     
  • David S. Rushby

    David S. Rushby - 2002-08-20
    • status: open --> closed
     

Log in to post a comment.

Auth0 Logo