Giter Club home page Giter Club logo

Comments (2)

ogobrecht avatar ogobrecht commented on May 26, 2024 1

Hi,

the best solution would be to use sys_guid as a default value in the table like so:

CREATE TABLE test (
    id      VARCHAR2(100 CHAR) DEFAULT ON NULL sys_guid() NOT NULL PRIMARY KEY,
    value   VARCHAR2(1000 CHAR)
);

BEGIN
    om_tapigen.compile_api(p_table_name => 'TEST');
END;
/

BEGIN
    test_api.create_row(p_id => NULL, p_value => 'test data');
    test_api.create_row(p_id => sys_guid(), p_value => 'test data');
    COMMIT;
END;
/

Then it does not matter if you provide the id in you business logic or not - it will work in both cases. Try it by yourself with the test script above.

As you already mentioned - it has nothing to do with the TAPI generator. The ability to provide a sequence name during the API generation is for old database releases which are not able to use a sequence as a column default and to create a table API without the need to create a trigger only for the sequence handling - this can be done then by the table API. If you have a newer DB release you don't need this anymore.

Hope this answers your question.

Kind regards
Ottmar

from table-api-generator.

fszilinski avatar fszilinski commented on May 26, 2024

OK, forget this question. The API itself AND the DML views are completely independent. It depends on the caller that have to pass the ID as value, so sequence and guid is possible, right?

from table-api-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.