Comments (2)
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.
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)
- Toggle not to use NotNull-Constraints HOT 4
- new Parameters p_enable_col_camel and p_enable_prefic_fnc_prc HOT 1
- Primary key not returned on create_row when XMLTYPE column is present HOT 4
- Primary key missing from create_row when identity column is used as PK HOT 4
- Add support for multitenant applications HOT 12
- Generate a function named get_default_row when parameter p_enable_column_defaults is set to true HOT 1
- Development branch: When parameter p_enable_column_defaults is set to true the compiled TAPI is sometimes invalid HOT 1
- compile error HOT 6
- Exception Handling HOT 2
- Oracle 23c Free - Install-Script returns ORA-01422 HOT 3
- Tenant column filter is missing from generated views HOT 1
- Specifying shorter table name substitution variables in p_one_to_one_view_name generates corrupted view name HOT 1
- P%COLUMN_MAPPING parameters are case sensitive HOT 1
- Error installing on oracle 23c free HOT 2
- Generating default values for virtual columns HOT 1
- Enhancement: QuickSQL-like validation and/or transformation
- Read row by unique keys lists tenant column as a parameter
- Boolean support Oracle 23c HOT 1
- p_enable_proc_with_out_params: No OUT Parameters being generated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from table-api-generator.