meedo
meedo

Reputation: 21

Oracle APEX - get workspace for current app

I need workspace name of the current app to access RESTful API.

Is there any substitution string for this? Or what is easiest way to get workspace name of the current app?

Upvotes: 0

Views: 9878

Answers (4)

Alexandre Carvalho
Alexandre Carvalho

Reputation: 83

You can use one of those for the ID:

Bind variable -> :WORKSPACE_ID
PL/SQL -> V('WORKSPACE_ID')
Substitution string -> &WORKSPACE_ID.
SYS_CONTEXT variable - > SELECT ... WHERE workspace_id = SYS_CONTEXT('APEX$SESSION', 'WORKSPACE_ID')

And to get the name:

select workspace from apex_workspaces where workspace_id = :WORKSPACE_ID

or

select workspace from apex_workspaces where workspace_id = SYS_CONTEXT('APEX$SESSION', 'WORKSPACE_ID')

Upvotes: 1

meedo
meedo

Reputation: 21

We didn't find solution what is wrong with apex_applications, so we used workaround with apex_040200.wwv_flow_authorized which is working correctly for us.

Upvotes: 0

select workspace
from apex_applications
where 1=1
  and application_id = :app_id

You don't need to apex_administrator_role as another answer suggests unless the parsing schema is not assigned to the current workspace.

Upvotes: 0

jareeq
jareeq

Reputation: 441

select * from apex_applications

You need apex_administrator_role to obtain not only current schema applications. ...And if you are new you need to be aware of administration role implications.

Upvotes: 0

Related Questions