APEX or SQL Developer?
Hello,
This is my first time posting here, I hope I have put it in the right section.
I was told that in order to have SPARQL with Oracle, I should use either APEX or SQL Developer, and not to install Oracle Enterprise. (I have never worked with it, and am a bit lost).
Is it possible to write SPARQL queries in this manner? Which is recommended for a beginner that only knows basics of SQL? Which has a more user-friendly interface?
I would very much appreciate the help.
Thank you :)
Edited by: user13098869 on 14-Nov-2010 02:39
Hi
APEX - Oracle Application Express is a no-cost option of the Oracle database.
SQL Developer is a tool that connects to the database to execute queries and PLSQL code
I do not know how APEX or SQL Developer would work with SPARQL.
One way to work with SPARQL with Oracle is using the Jena Adaptor. This is a set of tasks you would need to perform:
1. Install Oracle Database Enterprise Edition
2. Configure the database to use Semantic Technologies
3. Install JDK
4. Install Jena
5. Install Jena Adaptor
6. Review Jena Adaptor Demos that include SPARQL examples
Jena Adaptor Tutorial:
http://download.oracle.com/otndocs/tech/semantic_web/pdf/semtech11gr2_jenaadapt-tl.pdf
From Test8.java on you can see some SPARQL examples
This is the Oracle Semantic Technologies Web Page:
http://www.oracle.com/technetwork/database/options/semantic-tech/index.html
This is my scratch pad that I used when doing these tasks in case it helps:
1. Install 11.2.0.2.0
and
2. Create database at time of installation.
3. Create tablespace for Semantics:
create tablespace RDF_TABLESPACE
datafile '/.../rdf01.dbf' size 2000M
autoextend on next 2000M maxsize 16000M;
4. Setup Semantic Technologies:
sqlplus / as sysdba
@?/md/admin/catsem
exec sem_apis.create_sem_network('RDF_TABLESPACE');
5. Place files in working directory:
JDK: jdk-6u22-linux-x64.bin
Jena: jena-2.6.3.zip
Jena Adaptor ./JenaAdaptor/jena_adaptor_for_release11.2.zip
6. Unzip files:
unzip jena-2.6.3.zip
cd JenaAdaptor
unzip jena_adaptor_for_release11.2.zip
7. Install JDK:
chmod u+x jdk-6u22-linux-x64.bin
./jdk-6u22-linux-x64.bin
answer: yes
8. You should have in your working directory:
Wdir> ls -l
total 70388
drwxr-xr-x 8 ... Jena-2.6.2/
drwxr-xr-x 7 ... JenaAdaptor/
-rwxr--r-- 1 ... jdk-1_5_0_21-linux-i586.bin*
drwxr-xr-x 9 ... jdk1.5.0_21/
-rw-r--r-- 1 ... jena-2.6.2.zip
9. Copy files:
a. Copy ojdbc5.jar into <Jena_DIR>/lib (Linux) or <Jena_DIR>\lib (Windows). (ojdbc5.jar is in
$ORACLE_HOME/jdbc/lib or %ORACLE_HOME%\jdbc\lib.)
cp $ORACLE_HOME/jdbc/lib/ojdbc5.jar .../Jena-2.6.2/lib
b. Copy sdordf.jar into <Jena_DIR>/lib (Linux) or <Jena_DIR>\lib (Windows). (sdordf.jar is in
$ORACLE_HOME/md/jlib or %ORACLE_HOME%\md\jlib.)
cp $ORACLE_HOME/md/jlib/sdordf.jar .../Jena-2.6.2/lib
c. Copy sdordfclient.jar. It is in Work_dir/JenaAdpator/jar
cp .../JenaAdaptor/jar/sdordfclient.jar .../user/Jena-2.6.2/lib
10. Environmental variables:
export JAVA_HOME=.../user/jdk1.5.0_21/bin
export PATH=.../user/jdk1.5.0_21/bin:$PATH
11. To compile the examples:
copy the *.java examples to JENA_DIR/lib
cp .../user/JenaAdaptor/examples/*.java .../user/Jena-2.6.2/lib
-- To compile:
cd .../user/Jena-2.6.2/lib
javac -classpath ./:./jena-2.6.2.jar:./sdordfclient.jar:./ojdbc5.jar:slf4j-api-1.5.6.jar:log4j-
1.2.13.jar:slf4j-log4j12-1.5.6.jar:arq-2.8.1.jar:xercesImpl-2.7.1.jar Test.java
-- To run:
cd .../user/JenaAdaptor/examples
java -classpath ./:./jena-2.6.2.jar:./sdordfclient.jar:./ojdbc5.jar:slf4j-api-1.5.6.jar:log4j-
1.2.13.jar:slf4j-log4j12-1.5.6.jar:arq-2.8.1.jar:xercesImpl-2.7.1.jar:iri-0.7.jar:icu4j-3.4.4.jar
Test jdbc:oracle:thin:@caosspc46.ca.oracle.com:1521:orcl1102 rdfusr rdfusr Family
You should see:
| f | k |
=========================================================
| <http://example.com/John> | <http://example.com/Mary> |
Regards!
Jorge
Similar Messages
-
Administration of APEX in SQL Developer with Proxy Authentication impossibl
Hello!
We are using latest version of SQL Developer to administer APEX. We are connecting to the database with proxy authentication. The syntax is:
personal_user[apex_ws_owner]
e.g.: mdecker[apex_demo]
When trying to deploy APEX application I go to "Database Object" -> Application Express -> Application1 [100] -> right mouse click: "Deploy Application". Then I select the appropriate database identifier and next, I am presented with a screen showing import options. In second line, it says: "Parsing Schema: MDECKER".
This is wrong: it has to be Parsing Schema: APEX_DEMO. It seems that managing APEX with SQL Developer does not support Proxy Authentication.
Could you please confirm?
Is there a way to formally ask for this enhancement?
Best regards,
Martin
Update:
I found out that if I check the flag "Proxy Authentication" in the connect details and provide both passwords, the deploy application parsing schema is set to the correct APEX_DEMO account. However, we are using Proxy Authentication in order to avoid having to know the application password.
Edited by: mdecker on Jan 28, 2013 4:48 PMThere is a write-up about connecting to APEX here: <a href ="http://www.oracle.com/technology/products/database/application_express/html/sql_dev_integration.html" >SQL Dev Oracle APEX Integration</a>
<p>You do need to have updated to Oracle APEX 3.0.1.
<p>Regards <br>
Sue -
Publish to APEX in SQL Developer
Hello:
I wrote a query in SQL Developer and I want to utilize the Publish to APEX feature.
In SQL Developer, I right-click and select Publish to APEX.
I select the workspace, enter an application, select a theme, and enter a page.
I receive a message stating that it was successful.
I then go to APEX and login in as myself into my workspace which is the same workspace I designated in SQL Developer for this publish.
At the login, I enter my username and password.
I go to Application Builder, select the new application that was published, click Run.
I'm prompted for a login, so I enter my username and password and I receive Invalid Login Credentials.
Does anyone know what is causing this issue? I am the developer. I am an administrator. I'm using the same logins I always do when working with APEX. I'm not sure why I'm receiving this message.
Can someone help me?
Thanks.I don't think Apex is set up to accept this, but as the previous post says once you have the username/password of the underlying Oracle schema you should be able to do this. My particular case was jDeveloper and offline database objects, but the principle is the same. If you have admin access to the database go in as sys and change the password of the underlying Oracle user.
-
Remote debugging with APEX and SQL Developer
Hi,
I have problems concerning breakpoints within my SQL Packages I want to debug.
I want to force SQL-Developer to suspend execution of a function, so I can get forward step by step.
The SQL-Developer do not stop executing at the breakpoints I set in the Package.
The message I get is the following (on SQL-Developer side):
Debugger accepted connection from remote process on port 4000.
Processing 110 classes that have already been prepared...
Finished processing prepared classes.
Debugger disconnected from remote process.
Seems to me, that the process runs into the debug-mode but leave without stopping at a given breakpoint??
Do anybody have an idea how to solve it?
We use Oracle 10.2.0.3.0, SQL Developer 1.5.1 and APEX 3.1.2.
The Package-function I want to debug runs on another Oracle database as the APEX application.
Thanks in advance
Regards
Norbert
Edited by: Norbert2 on Apr 20, 2009 5:47 AMHi Carsten,
now I have done a further step. I can debug a remote PL/SQL-Package through APEX, but now I get an exception when the program execution jumps back to the APEX PL/SQL-Package.
My APEX-Page-Process looks like this:
BEGIN
dbms_debug_jdwp.connect_tcp(host => 'IP-ADDRESS', port => '4201');
APEX_TEST_PKG.remoteDebug;
dbms_debug_jdwp.disconnect;
END;The procedure APEX_TEST_PKG.remoteDebug looks like this (located on the APEX-DB):
PROCEDURE startRemoteDebug
AS
v_string VARCHAR2(50) := '';
BEGIN
[email protected](host => 'IP-ADDRESS', port => '4000',
option_flags => dbms_debug_jdwp.connect_defer_suspension);
v_string := [email protected];
DBMS_OUTPUT.PUT_LINE(v_string);
[email protected];
END remoteDebug; The procedure REMOTE_TEST_PKG.testFunc looks like this (located on the Remote-DB):
FUNCTION testFunc RETURN VARCHAR2
AS
v_string VARCHAR2(50) := '';
BEGIN
v_string := 'Test';
RETURN v_string;
END testFunc; When I start the debug session without the option dbms_debug_jdwp.connect_defer_suspension, I get an exception Oracle.EXCEPTION_ORA_604.
Starting the debug session with the above mentioned option, I am able to debug the remote function.
But now I get an exception when the executor tries leaving the remote function going back to the invoking function. With the debugger I can step over the return-statment successfully and the debugger steps on the next line END testFunc;. On this line I get the exception above
Exception breakpoint occurred at line -1 of PBREAK.pls.
$Oracle.Builtin.EXCEPTION_USER:
Exception breakpoint occurred at line -1 of PBREAK.pls.
$Oracle.Builtin.EXCEPTION_USER: I tried another way where I get now exception and where I can step through my functions in APEX, descending to functions in the remote db and going back to APEX.
For this case I put the debug-statements in remote function:
FUNCTION testFunc RETURN VARCHAR2
AS
v_string VARCHAR2(50) := '';
BEGIN
dbms_debug_jdwp.connect_tcp(host => 'IP-ADDRESS', port => '4000');
v_string := 'Test';
dbms_debug_jdwp.disconnect;
RETURN v_string;
END testFunc; But I have no idea why it doesn't work properly starting the remote debug session in the apex procedure.
Regards
Michael
Edited by: user6044915 on 02.09.2009 04:08
Edited by: user6044915 on 02.09.2009 04:21
Edited by: user6044915 on 02.09.2009 04:28 -
A coworker that works in Oracle told me today that he heard that a future release of SQL Developer was going to be integrated with Apex.
Is that correct? If so, does anyone know how the two products will be integrated?
Thanks, TonyHi Tony,
I wouldn't think so, because SQL Developer is done with a completely different development language (Java) then APEX is (PL/SQL). I think it goes more into the other direction, you will see more APEX related features in SQL Developer. The current APEX reports and the deployment feature in SQL Developer are just the beginning.
But what do I know, I'm not from Oracle...
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/ -
Connect to APEX /w SQL Developer
Hi everyone,
i've just created a free apex schema on apex.oracle.com.
Can i connect to this database with my local SQL Developer somehow?Jari's right. Also see the following for more information;
Connect apex.oracle.com workspace schema using a developer tool
Kofi -
Cann't connect to apex from sql developer
Platform: win8.
XE and SQL Dev work properly.
Connecting under XE database user "system" (it doesn't matter, the result will be the same).
Trying to connect to "localhost-1521-xe" I get
Status : Failure -Test failed: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified
Trying to connect to "local/bequeath" I get
Status : Failure -Test failed: C:\oraclexe\app\oracle\product\11.2.0\server\bin\ocijdbc11.dll: Can't load IA 32-bit .dll on a AMD 64-bit platformJari's right. Also see the following for more information;
Connect apex.oracle.com workspace schema using a developer tool
Kofi -
SQL Developer video problems on Parallels (Win XP)
I am running ORACLE 11G, APEX and SQL Developer on my MacBook pro. Initially I installed 1.5.4 SQL Developer and I stared having problems when editing SQL scripts.
Edit window, blacks out the lines which are not being viewed. Very annoying when working on complex scripts.
Although I've reported this problem to Parallels support, given that SQL Developer is the only application causing the problem is making me think it is more likely an issue with SQL Developer.
Since then I went back to 1.5.1 version and having same problem.
Any body else having this problem?
I might try 1.5.4 with patch #2 . . .
Details related to SQL Developer installed:
Oracle SQL Developer 1.5.1
Version 1.5.1
Build MAIN-5440
Copyright © 2005,2008 Oracle. All Rights Reserved.
IDE Version: 11.1.1.0.22.49.35
Product ID: oracle.sqldeveloper
Product Version: 11.1.1.54.40
Version
Component Version
========= =======
CVS Version Internal to Oracle SQL Developer (client-only)
Java(TM) Platform 1.5.0_06
Oracle IDE 1.5.1.54.40
Versioning Support 1.5.1.54.40
Edited by: APEX minded on 27/05/2009 17:12I will post this info to help people who may have similar problem.
The work around I found is to run Parallels in full-screen mode.
Parallels support haven't provided a fix for this yet. -
Apex Listener 2.0.1 / Sql Developer 3.2.20.09 / Apex 4.1.1
1. I'm using basic connection type with service name. Each time I connect to listener administration it is resetted to SID with default name as orcl.
2. Test Settings does not work in case hostname is localhost.
Database Settings apex:Cannot connect to APEX_PUBLIC_USER. Исключение ввода/вывода (input/output exception): The Network Adapter could not establish the connection>
At the same time it's working in defaults.xml:
<entry key="db.hostname">localhost</entry>I'm not sure why. Database and Apex Listener are installed on the same mashine. May be this can help:
<Warning> <Server> <x> <> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <> <BEA-002611> <Hostname "x", maps to multiple IP addresses: 10.110.x.x, 0:0:0:0:0:0:0:1> 3. I can see "Enable RESTful Services" action in (url http://docs.oracle.com/cd/E35137_01/appdev.32/e35117/intro.htm#autoId110)SQL Developer User's Guide. Still there is no such action in Sql Developer. Thus settings are always uploaded with enabled RESTful Services.
I see error
The pool named: apex_al does not existeach time I connect to Apex Listener Administration in case of RESTful Services is not configured during configuration of apex.war.
I can't find any restrictions for RESTful Services to be configured. So I think this error is unnecessary.
4. From sql developer User's Guide
Connect (context menu only): Connects to the Application Express Listener (see Connecting to Application Express Listener Server).Retrieve Settings, Upload Settings, and Launch URL are enabled when you connect to the Application Express Listener.>
administration settings are retrieved and displayed but still Retrieve Settings, Upload Settings, and Launch URL are disabled in context menu after connection.
I need to perform New Administration action to make them enabled.
Is this expected behavior ?
Is this all bugs or known features ?
Regards,
IgorDB: V11.2
APEX V 4.2.3.00.08
APEX Listener: V2.0.5.287.04.27
SQLDeveloper: Version 3.2.20.09
OS WIndows 7 64 bit
I am trying to create a connection to a standalone Apex Listener installation via SQL Developer to manage the listener settings. I start a new connection and after entering the UN/PWD of the Listener Administrator I get the following error:
Authentication failed
"CANNOT CONNECT TO CONNECTION.
INVALID RESOURCE OWNER CREDENTIALS"
In the Standalone APEX Listener DOS window I'm getting the following error message:
SEVERE: The pool named: apex_al does not exist
So where do I even start to trouble shoot this???
I add a connection as follows:
Connection Name: Connection
Usename: adminlistener (pwd=adminlistener configured using command :java -jar apex.war user adminlistener "Listener Administrator")
HTTP radio button
Hostname: localhost
Port: 8080
Server Path: /apex
thanks in advance
Paul Platt -
Background
1. Weblogic 10.3.6.0 running on Oracle Linux 6.5 with Oracle JRockit(R) (build R28.2.3-13-149708-1.6.0_31-20120327-1523-linux-x86_64, compiled mode)
2. Oracle Apex 4.2.1
3. Apex Listener 1.1.3
4. Apex and Apex Listener running on the Weblogic box above
5. SQL Developer 4.0.2 running on Windows 7 64 bit / Java 1.7.0_55
Updated Apex to 4.2.5 via p17966818_425_Generic.zip patchset. Apex environment running fine as do all applications via Listener 1.1.3
Updated Oracle Listener to the latest version of Oracle REST Data Services 2.0.7
Current Status
Apex Applications and RESTful services are running fine.
Problem
Unable to connect SQL Developer 4.0.2 to Oracle REST Data Services 2.0.7
Error message in SQL Developer - Cannot connect to DEV. HTTP/1.1 403 Target service not allowed
Additional Information
Steps followed -
1. The oracle users APEX_LISTENER and APEX_REST_PUBLIC_USER did not exist, so I ran apex_rest_config.sql from the APEX 2.4.1 patchset whilst connected sys as sysdba and provided the same password as APEX_PUBLIC_USER for both users.
2. I also ran
grant insert, delete on APEX_040200.wwv_flow_rt$privilege_groups to APEX_LISTENER;
alter session set current_schema = APEX_LISTENER;
create or replace synonym wwv_flow_rt$privilege_groups for APEX_040200.wwv_flow_rt$privilege_groups;
as per Oracle SQL Developer User's Guide Release 4.0
3. copied ords.war to apex.war
4. java -jar apex.war configdir /u01/app/oracle/admin/apex/devdomain1/
5. java -jar apex.war
Jun 5, 2014 5:15:31 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: /u01/app/oracle/admin/apex/devdomain1/apex
Enter the name of the database server [localhost]:dbservername
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:1
Enter the database service name:dbservicename
Enter the database user name [APEX_PUBLIC_USER]:
Enter the database password for APEX_PUBLIC_USER:
Confirm password:
Enter 1 to enter passwords for the RESTful Services database users (APEX_LISTENER,APEX_REST_PUBLIC_USER), 2 to use the same password as used for APEX_PUBLIC_USER or, 3 to skip this step [1]:2
Jun 5, 2014 5:16:52 PM oracle.dbtools.common.config.file.ConfigurationFiles update
INFO: Updated configurations: defaults, apex, apex_al, apex_rt
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2
6. java -jar apex.war user adminlistener "Listener Administrator"
Jun 5, 2014 5:18:52 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: /u01/app/oracle/admin/apex/devdomain1/apex
Enter a password for user adminlistener:
Confirm password for user adminlistener:
Jun 6, 2014 5:19:12 PM AM oracle.dbtools.standalone.ModifyUser execute
INFO: Created user: adminlistener in file: /u01/app/oracle/admin/apex/devdomain1/apex/credentials
7. Updated the defaults.xml file
Added
<entry key="apex.security.user.roles">RESTful Services</entry>
<entry key="apex.security.developer.roles">OAuth2 Client Developer, SQL Developer</entry>
as per Oracle SQL Developer User's Guide Release 4.0
Changed
<entry key="debug.printDebugToScreen">false</entry>
to
<entry key="debug.printDebugToScreen">true</entry>
for RESTful debugging
Added
<entry key="security.verifySSL">false</entry>
to use OAuth2 in Non HTTPS Environment as per Oracle® REST Data Services Installation and Configuration Guide, Release 2.0
8. Deleted the Admin and Manager Roles within the apex application deployment which were part of the Apex Listener 1.1.3 install
9. Deployed the apex.war in weblogic
10. Stopped and started the weblogic server to which apex.war was deployed
11. In SQL Developer, View, RESTful Services. In the RESTful services windows hit connect, Create a new connection,
Connection Name DEV
Username adminlistener
selected http protocol
Hostname weblogicservername
Port 7250
Server Path /apex
Workspace (blank)
On the Authentication dialog
Username adminlistener
Password passwordsuppliedabove in step 6
Response is a dialog box titled Authentication Failed
message - Cannot connect to DEV. HTTP/1.1 403 Target service not allowed
NOTHING UNUSUAL IN ANY OF THE WEBLOGIC LOG FILES, EXCEPT THAT IT STATES
'Oracle REST Data Services version : 2.0.6.27.18.06' when I've installed 2.0.7.
Any help much appreciatedFurther to the above post, I thought I'd simplify my Apex Listener install just to see if I can connect to it via SQL Developer
So downloaded the latest version 2.0.8 and decided to configure and run the Listener on my pc whilst still connecting to the same database.
Operating system : Window 7 Pro 64 bit
Oracle Apex Listener 2.0.8
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Went through the configuration as above, once started I tried again to access the listener via SQL Developer. This time I received this output from the listener:
INFO: Error: ORA-02291: integrity constraint (APEX_040200.WWV_FLOW_RT$APPROVALS_SGID_FK) violated - parent key not found, occurred during execution of: [CALL, insert into wwv_flow_rt$approvals (user_name,status,client_id,security_group_id,created_by,created_on,updated_by,updated_on) values(/*in:user_id*/?,/*in:status*/?,/*in:client_id*/?,/*in:tenant_id*/?,upper(/*in:user_id*/?),/*in:created*/?,upper(/*in:user_id*/?),/*in:created*/?), [tenant_id, in, class java.math.BigInteger], [client_id, in, class java.math.BigInteger], [user_id, in, class java.lang.String], [status, in, class oracle.dbtools.rt.oauth.ApprovalRequest$Status], [created, in, class java.sql.Timestamp]]with values: [adminlistener, APPROVED, 3858401374580004, -1, adminlistener, 2014-06-23 12:19:18.785, adminlistener, 2014-06-23 12:19:18.785]
SQL Developer responded with an Authentication Failed titled dialog with the following displayed in the body of the dialog
Cannot connect to DEV.
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7 no-css3"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8 no-css3"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html>
<!--<![endif]-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style type="text/css" media="screen">html,body,div,span,h3,p,ol,ul,li,header,hgroup{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}header,hgroup{display:block}body{font:normal 12px/16px Arial,sans-serif;margin:0 auto;background:#6a9cda}header#xHeader{border-bottom:1px solid #8fa4c0;position:relative;z-index:10;background:none #000}header#xHeader hgroup{width:974px;margin:0 auto;position:relative;height:36px;background:none #000}header#xHeader a#uLogo{margin:8px 0;display:inline-block;font:bold 14px/20px Arial,sans-serif;color:#AAA;text-decoration:none}header#xHeader a#uLogo span.logo{color:#F00}.no-css3 div#xContentContainer div.xContent{padding-top:14px}.no-css3 div#xContentContainer div.xContent div.xMainLeft h2{margin-top:0}div#xWhiteContentContainer{margin-bottom:30px}div#xWhiteContentContainer.xContentWide{background:#FFF;margin-bottom:0}div#xWhiteContentContainer.xContentWide div.xWhiteContent{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}div#xWhiteContentContainer div.xWhiteContent{width:974px;margin:0 auto;padding:0 0 20px 0;background:#FFF;min-height:500px;-moz-border-radius:0 4px 4px 4px;-webkit-border-radius:0 4px 4px 4px;border-radius:0 4px 4px 4px;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15)}div#xContentHeaderContainer{background:#6a9cda;-moz-box-shadow:0 -1px 0 rgba(0,0,0,0.15) inset;-webkit-box-shadow:0 -1px 0 rgba(0,0,0,0.15) inset;box-shadow:0 -1px 0 rgba(0,0,0,0.15) inset}div#xContentHeaderContainer div.xContentHeader{width:974px;margin:0 auto;padding:30px 0 32px 0;position:relative;min-height:60px}div#xContentHeaderContainer div.xContentHeader h3{font:bold 24px/24px Arial,sans-serif;color:#fff;text-shadow:0 2px 1px rgba(0,0,0,0.25);margin:0 0 20px 0}div#xFooterContainer{min-height:200px;border-top:1px solid rgba(0,0,0,0.15);background:#6a9cda}body.errorPage div#xContentHeaderContainer div.xContentHeader{min-height:30px}body.errorPage div#xContentHeaderContainer div.xContentHeader h3{font:bold 30px/30px Arial,sans-serif;color:#FFF;text-shadow:0 1px 2px rgba(0,0,0,0.25);margin:0}div.errorPage p{font:normal 14px/20px Arial,sans-seri;color:#666;padding:0 0 10px 0}div.errorPage ul{list-style:disc outside;padding:0 10px 0;margin:0 0 20px 0}div.errorPage ul li{font:normal 12px/16px Arial,sans-serif;color:#666;margin:0 0 8px 10px}pre{font-family:Consolas,"Lucida Console","Courier New",Courier,monospace}
</style>
<script type="text/javascript" charset="utf-8">
'header hgroup'.replace(/\w+/g,
function(n) {
document.createElement(n)
</script>
<title>Internal Server Error</title>
</head>
<body class="errorPage">
<header id="xHeader">
<hgroup>
<a id="uLogo" href="./"><span class="logo">ORACLE</span>
REST DATA SERVICES</a>
</hgroup>
</header>
<div id="xContentHeaderContainer">
<div class="xContentHeader">
<h3>
<span class="statusCode">500</span> - <span
class="statusMessage">Internal Server Error</span>
</h3>
</div>
</div>
<div id="xWhiteContentContainer" class="xContentWide">
<div class="xWhiteContent">
<div class="errorPage">
<p>
<ul class="reasons">
</ul>
</p>
<p>
<pre>Request Path passes syntax validation
Mapping request to database pool: PoolMap [_failed=false, _lastUpdate=-1, _pattern=null, _poolName=apex, _regex=null, _type=REGEX, _workspaceIdentifier=null, _serviceName=null]
Applied database connection info
Attempting to process with PL/SQL Gateway
Not processed as PL/SQL Gateway request
Attempting to process as a RESTful Service
Choosing: oracle.dbtools.rt.oauth.TokenHandler as current candidate with score: Score [handle=null, score=0, scope=SecurityConfig [constraint=secure, realm=OAUTH_CLIENT, logonConfig=NONE], originsAllowed=[], corsEnabled=true]
Determining if request can be dispatched as a Tenanted RESTful Service
Request path has one path segment, continuing processing
No Tenant Principal established yet, continuing processing
APEX_LISTENER pool exists, continuing processing
No matching tenant found for: oauth2, cannot dispatch
Chose oracle.dbtools.rt.oauth.TokenHandler as the final candidate with score: Score [handle=null, score=0, scope=SecurityConfig [constraint=secure, realm=OAUTH_CLIENT, logonConfig=NONE], originsAllowed=[], corsEnabled=true] for: POST oauth2/token
oauth2/token authorized as: p6xycV-2QceFnFHkWyJlnA..
</pre>
</p>
<p>
<pre>WebException [statusCode=500]
at oracle.dbtools.rt.web.WebException.webException(WebException.java:343)
at oracle.dbtools.rt.web.WebException.internalError(WebException.java:262)
at oracle.dbtools.rt.oauth.jdbc.JDBCOAuthDataAccess.createApproval(JDBCOAuthDataAccess.java:514)
at oracle.dbtools.rt.oauth.jdbc.JDBCOAuthDataAccess.createApprovedRequest(JDBCOAuthDataAccess.java:181)
at oracle.dbtools.rt.oauth.OAuthAuthorization.resourceOwnerCredentials(OAuthAuthorization.java:654)
at oracle.dbtools.rt.oauth.OAuthAuthorization.tokenRequest(OAuthAuthorization.java:273)
at oracle.dbtools.rt.oauth.TokenHandler.post(TokenHandler.java:44)
at oracle.dbtools.rt.web.RequestHandler.response(RequestHandler.java:268)
at oracle.dbtools.rt.web.RequestHandler.dispatch(RequestHandler.java:361)
at oracle.dbtools.rt.web.RequestHandler.dispatch(RequestHandler.java:85)
at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:93)
at oracle.dbtools.rt.web.ETags.checkPrecondition(ETags.java:93)
at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:426)
at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999)
at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434)
at oracle.dbtools.standalone.SecureServletAdapter.doService(SecureServletAdapter.java:91)
at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:196)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (APEX_040200.WWV_FLOW_RT$APPROVALS_SGID_FK) violated - parent key not found
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1046)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3713)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:230)
at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124)
at com.sun.proxy.$Proxy44.execute(Unknown Source)
at oracle.dbtools.common.jdbc.JDBCInsert.execute(JDBCInsert.java:58)
at oracle.dbtools.rt.oauth.jdbc.JDBCOAuthDataAccess.createApproval(JDBCOAuthDataAccess.java:487)
... 34 more
</pre>
</p>
</div>
</div>
</div>
<div id="xFooterContainer">
</div>
</body>
</html>
I am assuming this must be part of the problem I am seeing this the Weblogic deployment in my original post.
Does anyone have any suggestions on how best to tackle this?
Regards,
Derek -
Query works in SQL Developer but not in Oracle APEX
The query below runs and produces the correct result in SQL Developer, but when I try to put it into a PL/SQL process in Apex I get the error shown. There is no semi-colon at the end of the query in APEX.
The error is:
ORA-06550: line 10, column 54: PL/SQL: ORA-00933: SQL command not properly ended ORA-06550: line 2, column 1: PL/SQL: SQL Statement ignored ORA-06550: line 11, column 21: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with.
The query is:
SELECT *
FROM
(SELECT *
from T3_LEADS
WHERE
(SYSDATE - Last_Mailed_Date) > 60 OR Last_Mailed_Date is null
WHERE MARKET_ID = 'Salt_Lake_City' AND rownum <= 100That is because when you run a SQL in SQL*Plus or SQLDeveloper the output is displayed on the screen, but in Apex you need to select those values into variables so you can do something with the data.
delcare
v_emp_id employee.emp_id%type;
begin
select emp_id
into v_emp_id
from employee
where lname = 'JOHNSON' and fname = 'BILLY';
-- Then do something with that data
if v_emp_id between 1 and 10 then
end if;
end;Probably a bad SQL for an example. For your SQL though, you are selecting * which you would be able to select into a rowtype variable, but you are probably going to start having problems like "Exact fetch returns more that one row" since your query will probably return more that one value. In those cases you want to use cursors, and loop through the data one record at a time. You can Google all of that. -
Why does the query work in SQL Developer, but not in APEX?
Hi, guys:
I have a silly question. I have a complicated query, and I tested it successfully with SQL developer, and result is correct. However, when I put it into APEX to generate a report, it always reports no data found. I also know the condition related to "other marks" select list in the where clause part causes this problem. It also looks strange: before I add this condition, everything works OK; after I add this condition, even I do not choose the "other marks" select list, other components do not work neither. I always got no data found result. Could anyone help me on this problem? You can also visit our developing site as http://lsg-solutions.com:8888/apex/f?p=206 to check the problem.
Thanks a lot
Sam
select distinct 'MAP','Detail',so.doc_number as "DOC Number", so.offender_id as "Offender ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
so.date_of_birth as "Date of Birth",
(select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
(select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
(select sc8.description from sor_code sc8 where sc8.code_id=so.hair_color) as "Hair Color",
(select sc9.description from sor_code sc9 where sc9.code_id=so.eye_color) as "Eye Color",
replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, 'No Known Address'),'#'),',') as "Address",
replace(replace(nvl2(sl.physical_address1,sl.physical_address1||' '||sl.physical_city ||' '||sl.physical_county||' '||(select sc4.description from sor_code sc4 where sc4.code_id=sl.physical_state)||' '||sl.physical_zip, 'No Known Address'),'#'),',') as "Physical Address",
sl.status as "Status",
sl.jurisdiction as "Jurisdiction",
to_char(sl.ADDRESS_LATITUDE) as "Address Latitude",to_char(sl.address_longitude) as "Address Longitude",
to_char(sl.physical_address_latitude) as "Physical Latitude",to_char(sl.physical_address_Longitude) as "Physical Longitude",
decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated",
rox.status as "Registration Status",
rox.registration_date as "Registration Date",
rox.end_registration_date as "End Registration Date"
from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv
where rox.offender_id=so.offender_id
and sllv.offender_id(+)=so.offender_id
and sl.location_id(+)=sllv.location_id
and rox.status not in ('Merged')
and rox.reg_type_id=1
and upper(rox.status)='ACTIVE'
and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
and (((select sc11.description from sor_code sc11 where sc11.code_id=so.race and sc11.description=:P5_SL_RACE) is not null ) or (:P5_SL_RACE is null))
and (((select sc12.description from sor_code sc12 where sc12.code_id=so.sex and sc12.description=:P5_SL_SEX) is not null ) or (:P5_SL_SEX is null))
and (((select sc13.description from sor_code sc13 where sc13.code_id=so.hair_color and sc13.description=:P5_SL_HAIR_COLOR) is not null ) or (:P5_SL_HAIR_COLOR is null))
and (((select sc14.description from sor_code sc14 where sc14.code_id=so.eye_color and sc14.description=:P5_SL_EYE_COLOR) is not null ) or (:P5_SL_EYE_COLOR is null))
and (( so.offender_id in(select sm.offender_id from sor_code sc15, sor_mark sm, sor_offender so1 where sm.offender_id=so1.offender_id and sc15.code_id=sm.code and sc15.description=:P5_SL_OTHER_MARKS and sm.description is not null)) or (:P5_SL_OTHER_MARKS is null))My suggestion would be to put some instrumentation into your query and see what values you are using.. Or even simpler take out ALL the where clauses you can until data starts to sho wup and then add them back in one at a time until you find the culprit..
My bet would be on any date comparisons you are doing between page items and database columns..
Thank you,
Tony Miller
Dallas, TX -
Why will a query work in SQL Developer but not in Apex?
Here's a good one. I created a dynamic LOV with the following query.
select
e.DESCR d,
ee.ENTRD_EVNT_SK r
from
PT_EVNT_IN_DIV eid,
PT_ENTRD_EVNT ee,
PT_EVNT e
where ee.PGNT_SK = :PGNT_SK
and ee.CNTSNT_SK = :CNTSNT_SK
and ee.EVNT_IN_DIV_SK = eid.EVNT_IN_DIV_SK
and eid.EVNT_SK = e.EVNT_SK
and ee.ENTRD_EVNT_SK not in
(select js.ENTRD_EVNT_SK
from PT_JDG_SCR js
where js.JDG_SK = :JDG_SK
and js.PGNT_SK = :ai_pgnt_sk
and js.CNTSNT_SK = :CNTSNT_SK)
order by 1
The query works fine in SQL Developer, but Apex gives the following error when compiling it in the LOV editor.
"1 error has occurred
- LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
I tried rearranging the entries in the From clause, but that didn't do any good.
Do you see what I can do to make Apex accept it?
Thanks,
KimKim
Kim2012 wrote:
select
e.DESCR d,
ee.ENTRD_EVNT_SK r
from
PT_EVNT_IN_DIV eid,
PT_ENTRD_EVNT ee,
PT_EVNT e
where ee.PGNT_SK = :PGNT_SK
and ee.CNTSNT_SK = :CNTSNT_SK
and ee.EVNT_IN_DIV_SK = eid.EVNT_IN_DIV_SK
and eid.EVNT_SK = e.EVNT_SK
and ee.ENTRD_EVNT_SK not in
(select js.ENTRD_EVNT_SK
from PT_JDG_SCR js
where js.JDG_SK = :JDG_SK
and js.PGNT_SK = :ai_pgnt_sk
and js.CNTSNT_SK = :CNTSNT_SK)
order by 1
The column named ENTRD_EVNT_SK is used twice in a select. Once in the main select and once in the inline query.
The validation maybe choking on that.
Try giving the column in the inline query an alias and see if that helps.
Nicolette -
Apex report result doesn't agree with the result of sql developer
Hello guys,
at the moment I try to create a standard report which takes his content from several spreadsheets. Because of some problems with the searchbar I'm not able to use an interactive report. The sql query contains a function, which sets some space characters into the content of a column. But there is a big problem. When I call my sql query in apex from the spreadsheets the result doesn't agree with the result which affords the sql developer.
I know that the sql developer affords the right result.
best regards
wderr
Edited by: user9072567 on 07.02.2010 12:57thats the query:
select "TWORKITEM"."WORKITEMKEY",
"TWORKITEM"."PROJCATKEY",
"TPROJECT"."LABEL",
"TWORKITEM"."PACKAGESYNOPSYS",
replace(replace("TWORKITEM"."PACKAGEDESCRIPTION", chr(10), '<br>'),'<td></td>','<td></td>') packagedesc,
suche_ohne_ti_be("TWORKITEM"."WORKITEMKEY") "CHANGEDESCRIPTION"
from "TWORKITEM" "TWORKITEM", "TPROJECT" "TPROJECT", "TPROJCAT" "TPROJCAT"
where "TWORKITEM"."PROJCATKEY" = "TPROJCAT"."PKEY"
and "TPROJCAT"."PROJKEY" = "TPROJECT"."PKEY"
and (instr(upper("TWORKITEM"."WORKITEMKEY"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."WORKITEMKEY"))) > 0
or instr(upper("TPROJECT"."LABEL"), upper(nvl(:P10_SEARCHTEXT, "TPROJECT"."LABEL"))) > 0
or instr(upper("TWORKITEM"."PACKAGESYNOPSYS"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."PACKAGESYNOPSYS"))) > 0
or instr(upper("TWORKITEM"."PACKAGEDESCRIPTION"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."PACKAGEDESCRIPTION"))) > 0
or instr(upper(suche_ohne_ti_be("TWORKITEM"."WORKITEMKEY")), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."WORKITEMKEY")))>0
I mean with spreadsheets some tables/charts. And I take those informations from 3 of them.
regards
wderr -
Submiting a DB job in SQL developer for APEX workspace
Hi,
I am trying to run this procedure (which will be used to run a DB job daily) from SQL developer but i am getting some error:-
declare
cursor c1 is
select *
from ABC
where to_date(STARTDATE, 'DD-MON-YY') = (to_date(sysdate,'DD-MON-YY') + 7);
c_rec c1%rowtype;
begin
wwv_flow_api.set_security_group_id;
open c1;
loop
fetch c1 into c_rec;
exit when c1%NOTFOUND;
schema.package.SEND_EMAIL(c1.ID);
END LOOP;
CLOSE C1;
end;
The error I am getting is 6502 ORA-06502: PL/SQL: numeric or value error . If i run the same thing from APEX, it works fine. Please help!!
procedure send_email(p_id IN number)
as
cursor c2 is
select *
from a,b
where a.a_id =b.b_id
and C_ID = p_id
c2_rec c2%rowtype;
begin
wwv_flow_api.set_security_group_id;
open c2;
loop
fetch c2 into c2_rec;
exit when c2%notfound;
apex_send_email(p_to => c2_rec.to,
P_FROM => c2_rec.from,
P_BODY => 'test',
P_BODY_HTML => c2_rec.body_html,
P_SUBJ => c2_Rec.sub,
end loop;
close c2;
end;Hi,
>
procedure set_security_group_id(
p_security_group_id in number default null)
-- This procedure allows the caller to set wwv_flow_security.g_security_group_id
-- to the security group id of the schema they are currently running in.
>
When you call wwv_flow_api.set_security_group_id from SQL developer, you need pass p_security_group_id.
Try e.g. something like this if you do not know what is your workspace id
wwv_flow_api.set_security_group(APEX_UTIL.FIND_SECURITY_GROUP_ID (p_workspace=>'YOUR_WORKSPACE');Change YOUR_WORKSPACE to workspace name where your database schema is assigned
Br,Jari
Maybe you are looking for
-
Dual graphics adapters in HP 500-205t desktop
I've got an HP 500-205t with which I ordered a dedicated video card upgrade. The computer is about six months old. I now find I have a need for dual monitors. The dedicated adapter has only one output. The integrated one has two. Is there any way to
-
Hi All, I have written a select command on the table COEP based on objnr and vrgng fields ( both are required ) So when i was execuiting the query it was taking too much time for a single record. Can you guide me the alternative table or alternative
-
Setup Vendor for no freight charge
Hi, We have a requirement where we like to setup some vendors in the system for no freight charge. Scenario is as follows PO raised for vendor with no Freight charge Goods Receipted Invoice received from the vendor with freight charge. Account Payabl
-
Hi I'm planning to puchase captivate 4 I was wondering if it overcome the limitations I found in Captivate 3 1/ In drag drop in captivate 3. You can only drag and drop onto one correct option on the right hand side. I would like to have more than one
-
Unlocked phone turned to Locked after repair
Hi Can anyone please help me with the below question. I bought a new unlocked nokia lumia 710 from online vendor. I was using it for about 2 months and suddenly my phone hung. I reached to nokina support and they advised me to hard boot and several