Skip to content

Commit

Permalink
Allow other schemas to work via synonym and grants
Browse files Browse the repository at this point in the history
* Added `authid current_user` to package
  • Loading branch information
rimblas committed Jun 14, 2020
1 parent 4eaa66f commit b1e2719
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ Install the [ocd-table-column-reorder.sql](apex/ocd-table-column-reorder.sql)

The application will install the package [`ocd_table_reorder`](plsql/ocd_table_reorder.plb) as part of the installation or upgrade as a supporting object.

If you have multiple schemas on your Workspace you'll need to install the package on all of them. Yeah, I know...

If you have multiple schemas on your Workspace you can either:
* Install the package on each schema
* Create a synonym and grants

```
connect ORIGINAL_SCHEMA
grant execute on ocd_table_reorder to NEW_SCHEMA;
connect NEW_SCHEMA
create synonym ocd_table_reorder for ORIGINAL_SCHEMA.ocd_table_reorder;
```



This app now requires APEX 18.2 (but you could trivially backport to 18.1 if needed)
Expand Down
6 changes: 4 additions & 2 deletions apex/ocd-table-column-reorder-app.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ prompt APPLICATION 107 - The OCD Table Column Re-Orderer
-- Application Export:
-- Application: 107
-- Name: The OCD Table Column Re-Orderer
-- Date and Time: 16:22 Sunday June 14, 2020
-- Date and Time: 16:38 Sunday June 14, 2020
-- Exported By: JORGE
-- Flashback: 0
-- Export Type: Application Export
Expand Down Expand Up @@ -113,7 +113,7 @@ wwv_flow_api.create_flow(
,p_rejoin_existing_sessions=>'N'
,p_csv_encoding=>'Y'
,p_last_updated_by=>'JRIMBLAS'
,p_last_upd_yyyymmddhh24miss=>'20200614160425'
,p_last_upd_yyyymmddhh24miss=>'20200614163837'
,p_file_prefix => nvl(wwv_flow_application_install.get_static_app_file_prefix,'')
,p_files_version=>2
,p_ui_type_name => null
Expand Down Expand Up @@ -12255,6 +12255,7 @@ wwv_flow_api.create_install_script(
,p_script_type=>'UPGRADE'
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'create or replace package ocd_table_reorder',
'authid current_user',
'is',
'',
'procedure update_order(p_table_name in varchar2);',
Expand Down Expand Up @@ -12415,6 +12416,7 @@ wwv_flow_api.create_install_script(
,p_script_type=>'INSTALL'
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'create or replace package ocd_table_reorder',
'authid current_user',
'is',
'',
'procedure update_order(p_table_name in varchar2);',
Expand Down
1 change: 1 addition & 0 deletions plsql/ocd_table_reorder.pls
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
create or replace package ocd_table_reorder
authid current_user
is

procedure update_order(p_table_name in varchar2);
Expand Down

0 comments on commit b1e2719

Please sign in to comment.