Abha
Abha

Reputation: 347

How to import APEX application using SQLPLUS

I have build an application in APEX 18 on my Development environment. Now I want to deploy the whole application on Test environment. I have already exported the file from application builder, so I have the export sql with me.

My question is: Is there any way that I can import this file into my test environment using SQLPLUS and not by the Import functionality on application builder.

Can you please let me know the way to import using sqlplus.

Thanks, Abha..

Upvotes: 2

Views: 4678

Answers (1)

Adrian P
Adrian P

Reputation: 904

Definitely. It's well documented here:

https://docs.oracle.com/database/apex-18.2/AEAPI/Import-Script-Examples.htm

Here's what I'd typically have for an install script:

declare
    c_workspace constant apex_workspaces.workspace%type := 'DEMO';
    c_app_id constant apex_applications.application_id%type := 20000;
    c_app_alias constant apex_applications.alias%type := 'MYDEMO';

    l_workspace_id apex_workspaces.workspace_id%type;
begin
    apex_application_install.clear_all;

    select workspace_id
    into l_workspace_id
    from apex_workspaces
    where workspace = c_workspace;

    apex_application_install.set_workspace_id(l_workspace_id);
    apex_application_install.set_application_id(c_app_id);
    apex_application_install.set_application_alias(c_app_alias);
    apex_application_install.generate_offset;
end;
/

@f10000.sql

Upvotes: 7

Related Questions