Where is Oracle APEX source code framework located - oracle

Recently i start learning Oracle APEX and i have a question (i'm familiar with plsql):
Where is the source code for APEX located, in which schema ?
EG: For this piece of code where can i find APEX_COLLECTION.COLLECTION_EXISTS souce code :
IF :P9_HOW_MANY is NOT NULL and :P9_HOW_MANY > 0 then
IF NOT APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'CHILDREN') THEN
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
p_collection_name => 'CHILDREN');
END IF;
APEX_COLLECTION.ADD_MEMBERS(
p_collection_name => 'CHILDREN',
p_c001 => apex_application.g_f01,
p_c002 => apex_application.g_f03,
p_c003 => apex_application.g_f04,
p_c004 => apex_application.g_f02
);
End IF;
Thank you.

I think i found the answer, i will leave this here in case it helps anyone:
APEX_COLLECTION
APEX_ITEM
ETC..
all are public synonyms located in SYS schema and the source code is in APEX_190200 schema on the WWV_FLOW_COLLECTION package.

Related

How to register binary XML schema (using Oracle12c)?

I have a problem with registering BINARY XML schema using Oracle 12c version.
If I'm correct BINARY scheme registration option is available since Oracle 11g version? But using 12c it shows me an error that BINARY option is still not declared.
BEGIN
DBMS_XMLSCHEMA.REGISTERSCHEMA
(
SCHEMAURL => 'http://localhost:8080/public/leagues.xsd',
SCHEMADOC => bfilename('XMLDIR', 'LEAGUES.xsd'),
GENTYPES => FALSE,
OPTIONS => REGISTER_BINARYXML
);
END;
/
As a result of this, I receive an error :
PLS-00201: identifier 'REGISTER_BINARYXML' must be declared
Because that option (register_binaryxml) should be invoked through dbms_xmlschema package as dbms_xmlschema.register_binaryxml.
That is, replace options => register_binaryxml with options => dbms_xmlschema.register_binaryxml

Is there a way to change Application Availability by code on Oracle APEX 4.2.6

I need to change an Application Avaiability by code in Oracle Apex 4.2.
I APEX 5 there is a apex_util.set_application_status method. Is there anything similar on Apex 4?
Thanks!
I've been using this undocumented, unsupported API call for years with no problems so far:
wwv_flow_api.set_flow_status
(p_flow_id => 100
,p_flow_status => 'UNAVAILABLE_URL'
,p_flow_status_message => 'http://www.example.com/system_unavailable.html'
);
To make it available again:
wwv_flow_api.set_flow_status
(p_flow_id => 100
,p_flow_status => 'AVAILABLE'
);
To make the developer toolbar available:
wwv_flow_api.set_flow_status
(p_flow_id => 100
,p_flow_status => 'AVAILABLE_W_EDIT_LINK'
);
https://jeffkemponoracle.com/2015/07/deploying-apex-showing-an-under-maintenance-web-page/

Run exe from DBMS_SCHEDULER

I am kind of new in DMBS_SCHEDULER and I face some problems.
I want to run an .exe
So I created a Job:
begin
sys.dbms_scheduler.create_job(job_name => 'FTREC.EXE_1',
job_type => 'EXECUTABLE',
job_action => 'C:\Windows\System32\calc.exe',
start_date => to_date(null),
repeat_interval => '',
end_date => to_date(null),
job_class => 'IRECS_JOB_CLASS',
enabled => false,
auto_drop => false,
comments => '');
end;
I have also created credentials :
DBMS_SCHEDULER.CREATE_CREDENTIAL('WWLSERVER','WWLSERVER','1234',null,null,null);
And I applied the credentials to my job
dbms_scheduler.set_attribute('FTREC.EXE_1', 'credential_name', 'WWLSERVER');
But when I try to run my Job I get this error:
EXTERNAL_LOG_ID="job_255737_183883",
ORA-27369: job of type EXECUTABLE failed with exit code: The extended attributes are inconsistent.
What I am doing wrong?
Credentials were not available in 10g. There are no mentions of the word "credential" in the
DBMS_SCHEDULER documentation.
I was able to run your code in 12c. But running calc.exe created an un-killable session, I had to restart the database. Things went much better when I used a simple .bat file for testing.
This thread on the Oracle Forums has methods for running an external program on 10g.

Oracle PLSQL CreateSchemaBasedXML using multiple schemas

I am trying to perform XSD validation against an XML document within PLSQL and I'm having an issue with getting it working.
I have created an XMLTYPE object, which when I call isSchemaBased() against it returns 0 (false). Now obviously the XMLTYPE needs to be schema based in order to be validated, I found that you can make a schema based version by calling createSchemaBasedXML against the XMLTYPE. The problem I am having is that my schema is broken into two parts (combining the schema files is not an option unfortunately), which means that when I try and createSchemaBasedXML specifying the main schema it fails because it is unable to resolve a reference which is imported from the second XSD document.
-- lxml is the XMLTYPE which has been populated with the XML before this point
dbms_xmlschema.registerSchema(
schemaURL => mainSchemaURL,
schemaDoc => mainSchemaDoc,
local => true,
genTypes => true,
genTables => false,
force => true,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE);
dbms_xmlschema.registerSchema(
schemaURL => importedSchemaURL,
schemaDoc => importedSchemaDoc,
local => true,
genTypes => true,
genTables => false,
force => true,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE);
if lxml.isSchemaBased() = 1 then
dbms_output.put_line('Schema based');
else
dbms_output.put_line('Non-schema based');
end if;
dbms_ouput.put_line('About to apply schema');
lxml := lxml.createSchemaBasedXML(mainSchemaURL);
dbms_ouput.put_line('We don't get this far');
lxml := lxml.createSchemaBasedXML(importedSchemaURL);
Is there any way of being able to import both the mainSchemaURL and the importedSchemaURL at the same time so that the imported schema references within the main schema don't cause the failure;
ORA-31079: unable to result reference to type [type containing imported type]
Any help or pointers would be greatly appreciated.
UPDATE: I am working with Oracle version 11g
The answer was provided by 'odie_63' on the Oracle forums [here][1]
In the end it was a case of specifying the schemaLocation for the import of the importedSchema
[1]: https://forums.oracle.com/message/11135111 "CreateSchemaBasedXML using multiple schemas
"

Problem creating a Directory object in Oracle

The code is this:
Originally:(http://www.oracle-base.com/articles/misc/FTPFromPLSQL.php)
The approach uses a combination of the UTL_TCP and UTL_FILE packages to create a simple FTP API (ftp.pks, ftp.pkb). Once the API is loaded into the appropriate schema simple FTP commands can be initiated as follows:
CREATE OR REPLACE DIRECTORY my_docs AS '/u01/app/oracle/';
SET SERVEROUTPUT ON SIZE 1000000
#c:\ftp.pks
#c:\ftp.pkb
-- Send an ASCII file to a remote FTP server.
DECLARE
l_conn UTL_TCP.connection;
BEGIN
l_conn := ftp.login('ftp.company.com', '21', 'ftpuser', 'ftppassword');
ftp.ascii(p_conn => l_conn);
ftp.put(p_conn => l_conn,
p_from_dir => 'MY_DOCS',
p_from_file => 'test_get.txt',
p_to_file => '/u01/app/oracle/test_put.txt');
ftp.logout(l_conn);
END;
/
The problem is that when I try to create the directory object I get an error saying that Create symbol wasnt expected.
where this line should be created?
Is there anything preceding the create statement line in your script? It looks like there might be something you left off the post.

Resources