Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Command executing in SQLcl

Leandro AmorimJan 10 2024 — edited Jan 10 2024

Hello,

I'm trying to use PL/SQL in SQLcl, to export all applications in Apex, using the command apex export, like that:

BEGIN
FOR i IN (select application_id from apex_applications where workspace <> 'INTERNAL' order by 1) LOOP
exec 'apex export -applicationid ' || i.application_id || ' -skipExportDate -dir /oratmp/backup_apex/aplicacoes -expOriginalIds';
END LOOP;
END;

But I'm getting an error. I also tried also exec immediate and same problem.

That's the error:

Error report -
ORA-06550: line 3, column 14:
PLS-00103: Encountered the symbol "apex export -applicationid " when expecting one of the following:

:= . ( @ % ;
The symbol ":=" was substituted for "apex export -applicationid " to continue.
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.

In SQLplus something like that works fine, of course with other commands, because apex export exists only in SQLcl.

Can someone help me with this. I searched in documentation and found nothing.

Thanks!

Leandro

Comments
Post Details
Added on Jan 10 2024
6 comments
454 views