Comments (4)
Hi Paolo,
confirmed. This is a Bug. We introduced in 0.5.0 the possibility to return the whole row instead of the primary key (parameter p_return_row_instead_of_pk ).
The problem is that returning all table columns into a row type variable is not working when you have a xmltype column in your table. Here two example blocks for your test table - the first one will run:
set serveroutput on size unlimited
declare
v_row test%rowtype;
begin
insert into test (
table_id /*PK*/,
xml_template
) values (
test_seq.nextval,
xmltype('<TEST/>')
) returning table_id into v_row.table_id;
dbms_output.put_line('table_id=' || to_char(v_row.table_id));
end;
/
As soon as you include the xmltype column you will get an error (ORA-22816: unsupported feature with RETURNING clause):
set serveroutput on size unlimited
declare
v_row test%rowtype;
begin
insert into test (
table_id /*PK*/,
xml_template
) values (
test_seq.nextval,
xmltype('<TEST/>')
) returning table_id, xml_template into v_row;
dbms_output.put_line('table_id=' || to_char(v_row.table_id));
end;
/
This was the reason to decide to do the extra fetch when an xml column is present. This should only be the case when also the parameter p_return_row_instead_of_pk is set - but we forgot this condition in the code.
I will fix this on the weekend and provide a corrected version.
By the way, we are working currently on a new version which will introduce methods for bulk processing. Are you interested in this? If so, you are welcome as an early adopter for tests ;-)
You will hear from me the next days, best regards
Ottmar
from table-api-generator.
Hi Paolo,
the bugfix release 0.5.1 is available. Thank you for reporting the issue.
Best regards
Ottmar
from table-api-generator.
Hi Ottmar,
thanks a lot for the quick fix and the explanation!
Indeed I'd be very interested in the bulk processing functionality of the new version and I hope to find some time to test the development version.
I also have a new enhancement request, but I'll open a new ticket for it.
Thanks again,
Paolo
from table-api-generator.
Hi Paolo,
some hints for the new version:
- We check in currently every running version in the branch named "development".
- The docs for using the bulk methods needs to be aligned.
There are breaking changes:
To have similar behaviour between the bulk and the standard methods we skipped the checking for changes - that means all updates are passed thru the table instead of checked, if any changes occured to the record to avoid unnecessary changes.
We skipped also the generic change log. This was a problem before when multi column primary keys exist and is now a bigger problem with the bulk methods. If you need this feature we recommend to use the flashback data archive and not a trigger based solution because this is slowing down your overall data model performance. Hopefully you are not used the generic change log in the past -otherwise you have some amount of work to migrate to an other solution - sorry for that.
We introduced support for audit columns. That means the table API can do this for you instead of a trigger based solution. You should hide your data model in an extra schema and give only execute rights to the APIs to avoid manipulation of the audit columns. This is known as the SmartDB od PinkDB paradigm - see also this interesting post by Philip Salvisberg.
Let me know, if you need more informations or if you have any questions.
Best regards
Ottmar
from table-api-generator.
Related Issues (20)
- new Parameters p_enable_col_camel and p_enable_prefic_fnc_prc HOT 1
- Use SYS_GUID instead of sequence HOT 2
- 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
- Default Values for Interval columns with Precision generates invalid package 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.