Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #40

Merged
merged 20 commits into from
Jul 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ target
*.bak
*.log
.flattened-pom.xml
*.tmp
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ Types of changes:

- [It should be possible to exclude (temporary) database jobs while generating DDL.](https://github.com/paulissoft/oracle-tools/issues/22)

## [1.4.0] - 2022-07-17

### Added

- [The generated DDL install.sql should use show errors after every stored procedure.](https://github.com/paulissoft/oracle-tools/issues/37)

### Changed

- [When generating DDL the temporary file should be kept.](https://github.com/paulissoft/oracle-tools/issues/36)

### Fixed

- [The referential constraints are not created in the correct order in the install.sql file.](https://github.com/paulissoft/oracle-tools/issues/35)

## [1.3.2] - 2022-02-23

### Changed
Expand Down
3 changes: 1 addition & 2 deletions apex/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<plugins>
<!-- Configuration won't be propagated to children -->
<!-- do not use parent configuration -->
<!--
<!-- GJP 2022-06-20 Do not know why this has been commented out. Activate it again. -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
Expand All @@ -191,7 +191,6 @@
</descriptorRefs>
</configuration>
</plugin>
-->
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TYPE "ORACLE_TOOLS"."T_ARGUMENT_OBJECT" authid current_user is object

Please note that these arguments are only used in type methods. Only DATA_LEVEL 0 arguments are stored here.

USER_ARGUMENTS.POSITION is mapped to ARGUMENT#.
USER_ARGUMENTS.POSITION is mapped to ARGUMENT#.

Column Datatype Description
------ -------- -----------
Expand All @@ -15,7 +15,7 @@ CREATE TYPE "ORACLE_TOOLS"."T_ARGUMENT_OBJECT" authid current_user is object
-- ARGUMENT_NAME can refer to any of the following:
-- a) Return type, if ARGUMENT_NAME is null
-- b) The argument that appears in the argument list if ARGUMENT_NAME is not null

, data_type_name$ varchar2(30 char) -- Datatype of the argument
, in_out$ varchar2(9 char) -- Direction of the argument: IN, OUT or IN/OUT
, type_owner$ varchar2(30 char) -- Owner of the type of the argument
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TYPE "ORACLE_TOOLS"."T_DDL_SEQUENCE" authid current_user under oracle_tools.t_ddl
( overriding member procedure text_to_compare
( self in oracle_tools.t_ddl_sequence
, p_text_tab out nocopy oracle_tools.t_text_tab
, p_text_tab out nocopy oracle_tools.t_text_tab
)
)
final;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CREATE TYPE "ORACLE_TOOLS"."T_DEPENDENT_OR_GRANTED_OBJECT" authid current_user u
, overriding member procedure chk
( self in oracle_tools.t_dependent_or_granted_object
, p_schema in varchar2
)
)
, overriding member function base_dict_object_type return varchar2 deterministic
)
not instantiable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TYPE "ORACLE_TOOLS"."T_OBJECT_INFO_REC" AS OBJECT
CREATE TYPE "ORACLE_TOOLS"."T_OBJECT_INFO_REC" AUTHID DEFINER AS OBJECT
(OBJECT_SCHEMA VARCHAR2(128 CHAR),
OBJECT_TYPE VARCHAR2(30 CHAR),
OBJECT_NAME VARCHAR2(4000 CHAR),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
CREATE TYPE "ORACLE_TOOLS"."T_REF_CONSTRAINT_OBJECT" authid current_user under oracle_tools.t_constraint_object
( ref_object$ oracle_tools.t_named_object -- referenced table
( ref_object$ oracle_tools.t_constraint_object -- referenced primary / unique key constraint whose base object is the referencing table / view
, constructor function t_ref_constraint_object
( self in out nocopy oracle_tools.t_ref_constraint_object
, p_base_object in oracle_tools.t_named_object
, p_object_schema in varchar2
, p_object_name in varchar2
, p_constraint_type in varchar2 default null
, p_column_names in varchar2 default null
, p_ref_object in oracle_tools.t_named_object default null
, p_ref_object in oracle_tools.t_constraint_object default null
)
return self as result
-- begin of getter(s)
, overriding member function object_type return varchar2 deterministic
, member function ref_object_schema return varchar2 deterministic
, member function ref_object_type return varchar2 deterministic
, member function ref_object_name return varchar2 deterministic
, member function ref_base_object_schema return varchar2 deterministic
, member function ref_base_object_type return varchar2 deterministic
, member function ref_base_object_name return varchar2 deterministic
-- end of getter(s)
, overriding final map member function signature return varchar2 deterministic
, overriding member procedure chk
Expand All @@ -25,6 +28,12 @@ CREATE TYPE "ORACLE_TOOLS"."T_REF_CONSTRAINT_OBJECT" authid current_user under o
( self in out nocopy oracle_tools.t_ref_constraint_object
, p_ref_object_schema in varchar2
)
, static function get_ref_constraint -- get referenced primary / unique key constraint whose base object is the referencing table / view with those columns
( p_ref_base_object_schema in varchar2
, p_ref_base_object_name in varchar2
, p_ref_column_names in varchar2
)
return oracle_tools.t_constraint_object
)
final;
/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TYPE "ORACLE_TOOLS"."T_SCHEMA_OBJECT" authid current_user as object
, final member procedure network_link
( self in out nocopy oracle_tools.t_schema_object
, p_network_link in varchar2
)
)
, final member function object_schema return varchar2 deterministic
, final member procedure object_schema
( self in out nocopy oracle_tools.t_schema_object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TYPE "ORACLE_TOOLS"."T_TABLE_DDL" authid current_user under oracle_tools.
, overriding member procedure uninstall
( self in out nocopy oracle_tools.t_table_ddl
, p_target in oracle_tools.t_schema_ddl
)
)
, overriding member procedure add_ddl
( self in out nocopy oracle_tools.t_table_ddl
, p_verb in varchar2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_DDL_ERROR" IS
CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_DDL_ERROR" AUTHID DEFINER IS

-- The error_code is an integer in the range -20000..-20999 and the message is a character string of at most 2048 bytes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_DDL_UTIL" AUTHID CURRENT_USER IS
-- Constraints with different indexes fail because the index is already there:
--
-- ALTER TABLE "<owner>"."WORKORDERTYPE" ADD CONSTRAINT "WORKORDERTYPE_PK" PRIMARY KEY ("SEQ")
-- USING INDEX (CREATE UNIQUE INDEX "<owner>"."WORKORDERTYPE1_PK" ON "<owner>"."WORKORDERTYPE" ("SEQ")
-- PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
-- USING INDEX (CREATE UNIQUE INDEX "<owner>"."WORKORDERTYPE1_PK" ON "<owner>"."WORKORDERTYPE" ("SEQ")
-- PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
-- TABLESPACE "YSSINDEX" ) ENABLE;
--
c_#138707615_2 constant boolean := true;
Expand All @@ -59,11 +59,11 @@ CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_DDL_UTIL" AUTHID CURRENT_USER IS
c_get_library_ddl constant boolean := false;
c_get_operator_ddl constant boolean := false;
c_get_xmlschema_ddl constant boolean := false;

c_transform_param_list constant varchar2(4000 char) := 'SEGMENT_ATTRIBUTES,TABLESPACE';

/* TYPES */
subtype t_dict_object_type is all_objects.object_type%type;
subtype t_dict_object_type is all_objects.object_type%type;
subtype t_dict_object_type_nn is t_dict_object_type not null;

subtype t_metadata_object_type is varchar2(30 char);
Expand Down Expand Up @@ -135,7 +135,7 @@ CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_DDL_UTIL" AUTHID CURRENT_USER IS
, p_object_names_include in t_numeric_boolean default null
, p_network_link in t_network_link default null
, p_grantor_is_schema in t_numeric_boolean_nn default 0
, p_transform_param_list in varchar2 default c_transform_param_list
, p_transform_param_list in varchar2 default c_transform_param_list
)
return oracle_tools.t_schema_ddl_tab
pipelined;
Expand Down Expand Up @@ -449,7 +449,7 @@ $if oracle_tools.cfg_pkg.c_testing $then

--%beforeall
procedure ut_setup;

--%afterall
procedure ut_teardown;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_STR_UTIL" IS -- -*-coding: utf-8-*-
CREATE OR REPLACE PACKAGE "ORACLE_TOOLS"."PKG_STR_UTIL" AUTHID DEFINER IS /* -*-coding: utf-8-*- */

/**
* <h1>Functionality</h1>
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ $end

$if oracle_tools.cfg_pkg.c_debugging $then
dbug.leave;
$end
$end
exception
when others
then
$if oracle_tools.cfg_pkg.c_debugging $then
dbug.leave_on_error;
$end
$end
raise_application_error(oracle_tools.pkg_ddl_error.c_reraise_with_backtrace, dbms_utility.format_error_backtrace, true);
end p_generate_ddl;
/
Expand Down
Loading