Sample SQL code ( Oracle Spatial queries)

Hi All,
Can anyone tell me where can I get sample spatial queries.
Please tell me the urls for spatial queries.
Thank you
Anju

Hi All,
Can anyone tell me where can I get sample spatial queries.
Please tell me the urls for spatial queries.
Thank you
AnjuHow about the spatial users guide which is available on
http://technet.oracle.com/doc/inter.815/a67295/toc.htm
It also contains example statements.
There is also a
spatial_users_guide_817.pdf available
Gerjan

Similar Messages

  • Example Oracle Spatial Queries for NAVTEQ Data

    Hi,
    I recently installed NAVTEQ RDF data into an Oracle database. I am new to Oracle Spatial and am looking for some example queries using the NAVTEQ data in the Oracle database.
    For example, suppose I have a point (latitude,longitude). What are the queries for each of these:
    1) find roads or faces within 5 miles of that point;
    2) find roads or faces that cover that point
    Thanks!
    Bowden

    Hi,
    There are a lot of of ways to license the data (county, state, country), there are different flavors (mapping, geocoding, and routing), and there are different licensing options for the Oracle platform (user based and cpu/core based). I cannot think of a use case that would approach the cost below.
    Feel free to drop me an email (daniel dot abugov at navteq dot com) and we can discuss.
    Dan Abugov
    NAVTEQ Enterprise Business Development and Consulting

  • DigitalGlobe Sample Imagery in Oracle Spatial Georaster format

    "Sample data from Digital Globe for Oracle Spatial GeoRaster"
    DigitalGlobe Sample Imagery - Oracle Spatial formatted (GeoRaster) imagery of San Francisco.
    More cities will be added soon.
    http://www.oracle.com/technology/products/spatial/htdocs/spatial_partners_downloads.html#data

    Ok, good stuff.
    I downloaded it, but there is little documentation on how to get it in to Oracle.
    I tried to use the impdp utility, but got a ORA-39059: dump file set is incomplete
    after unzipping all the files in the import directory.
    Any ideas?

  • Oracle spatial with hibernate

    We're trying to use Hibernate to do Oracle spatial queries. Specifically to do things like "get all spatial objects that fall within this search circle." Instead we're getting things that are near the border of the search circle, but not things near the interior. Trying to figure out if we're building the Hibernate query wrong or if this is just something Hibernate/Oracle spatial can't do together.
    We're building Hibernate Criteria with statements like: "sdo_relate({alias}.GEOMETRY_3D, [geometry goes here], 'mask=anyinteract') = 'TRUE'"
    Anyone know of any common pitfalls when trying to do something like this, or known issues we can work around somehow?
    Thanks,
    M

    You might consider using Hibernate Spatial (http://www.hibernatespatial.org/). It extends hibernate with spatial types (using JTS) and support Oracle. There is an API specifically for this kind of queries.

  • Extended WKT notation in Oracle Spatial

    Hi,
    I have a AutoCAD spatial filter condition as follows,
    GEOM ENVELOPEINTERSECTS GeomFromText('POLYGON XYZ ((-60 45 0, 40 15 0, 30 15 0, -60 48 0, -60 33 0))').
    When I try to get the geometry in Oracle Spatial as below,
    Select SDO_UTIL.from_WKTGEOMETRY('POLYGON XYZ ((-60 45 0, 40 15 0, 30 15 0, -60 48 0, -60 33 0))') from dual;
    I am getting an error as "[Error] Execution (2: 8): ORA-29532: Java call terminated by uncaught Java exception: java.sql.SQLException: oracle.spatial.util.GeometryExceptionWithContext: java.lang.RuntimeException: Opening parentheses missing -3
         at oracle.spatial.util.WKT$WKTInputStream.readStartList(WKT.java:223)
         at oracle.spatial.util.WKBasis.readStartList(WKBasis.java:1542)
         at oracle.spatial.util.WKBasis.toJGeometry_WKB_POLYGON(WKBasis.java)
         at oracle.spatial.util.WKBasis.toJGeometry(WKBasis.java:1077)
         at oracle.spatial.util.WKBasis.toJGeometry(WKBasis.java:1033)
         at oracle.spatial.util.WKBasis.toSTRUCT(WKBasis.java:148)
         at oracle.spatial.util.Adapters.wktToSTRUCT2(Adapters.java:208)
         at oracle.spatial.util.Adapters.wktToSTRUCT(Adapters.java:198)
         at oracle.spatial.util.Adapters.wktToSTRUCT(Adapters.java:188)
    ORA-06512: at "MDSYS.SDO_UTIL", line 187"
    Validating the geometry gives null,
    SQL> Select SDO_UTIL.validate_WKTGEOMETRY('POLYGON XYZ ((-60 45 0, 40 15 0, 30 15 0, -60 48 0, -60 3
    3 0))') from dual;
    SDO_UTIL.VALIDATE_WKTGEOMETRY('POLYGONXYZ((-60450,40150,30150,-60480,-60330))')
    null null
    What am I doing wrong here? Also what is the equivalent sdo_util funtion for ENVELOPEINTERSECTS?
    Thanks.
    Ananda

    Hi folks,
    We talked in the past that a lot of this confusion could be mitigated if the Oracle documentation just stated clearly what version of the OGC specification the WKT functions support. Been a bit of talk on the forum recently on various OGC support issues and it strikes me as being kind of unproductive since nothing has changed in terms of OGC support since... I guess since the GML 3.1.1 functions were released with 11gR1. Is that correct? And before that? So the situation could be termed as being "very stable". :)
    Oracle Spatial WKT functionality (as of 11.2.0.3) pretty simply only supports the Simple Features 1.1 specification. End of story. Be nice if it said so here:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_util.htm#SPATL1234
    I'll try this weekend to submit an enhancement request for that as I don't think anyone else has.
    Meanwhile most of us either use Simon's JTS solution or long ago coded our own readers/writers in PLSQL.
    I've been trying to think of ways we could somehow inspire more forum users to submit SRs on the issues they bring up here. I am as lazy as the next person on the matter. Maybe some kind of point rewards for putting in SRs? I am not looking for folks to just knee-jerk submit SRs to every posting, but clearly there are some communities of interest (GML users for example) that could document their collective concerns through metalink.
    Cheers,
    Paul

  • Oracle Spatial book sample application

    Hi all,
    On Monday I received the Oracle Spatial book and I would like to post a topic about it. First of all I would like to congratulate the authors for their huge effort doing this excellent book. I think it will be very useful to the people that works with Spatial.
    Next, my question is about the sample application showed in chapter 12 (SampleApplication.jsp). I run correctly mapviewer in my server and I can do the other examples, nevertheless when I want to start this application I recieve this error message about 'jdbc/spatial10g not found' in my web browser:
    500 Internal Server Error
    javax.naming.NameNotFoundException: jdbc/spatial10g not found
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.rmi.RMIContext.lookup(RMIContext.java:149)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.ApplicationContext.lookup(ApplicationContext.java:248)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.ApplicationContext.lookup(ApplicationContext.java:119)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at spatial2d_book._sample_2d_app._SampleApplication._jspService(_SampleApplication.java:264)
         [SRC:/spatial-book/sample-app/SampleApplication.jsp:248]
         at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    I am using Java 2 Runtime Environment version 1.4.2_02 and I think I have correctly configured the shared libraries in the oc4j server (sdoapi.jar, sdonm.jar, ojdbc14.jar, etc.). Anyway, I think I will be missing something but I don't know what.
    I would be very grateful if somebody could help me.
    Juan M.

    Hi Juan
    Thanks for purchasing our book, and thanks also for the kind words.
    I think I know what that problem is.
    The application uses the network API. That API needs a database connection for the initial loading of the network. The connection used is provided by OC4J. This is done in the following code lines in the SampleApplication.jsp:
    // Get JDBC database connection
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("jdbc/"+dataSource.toLowerCase());
    Connection conn = ds.getConnection();
    // Load network
    net = NetworkManager.readNetwork(conn, networkName);
    In other words, for this to work, you need a datasource defined for OC4J, called "jdbc/spatial10g" (since dataSource is defined by default to be "SPATIAL10G".
    To define the datasource, refer to chapter 11, page 499, at the bottom of the page. You need to add the following to your data-sources.xml config file ($OC4J_HOME/j2ee/home/config/data-sources.xml):
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="spatial10g"
    location="jdbc/spatial10gCore"
    xa-location="jdbc/xa/spatial10gXA"
    ejb-location="jdbc/spatial10g"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="spatial"
    password="spatial"
    url="jdbc:oracle:thin:@localhost:1521:orcl101"
    inactivity-timeout="30"
    />
    (Adapt the url parameter to match your database definition)
    Thanks for pointing out this problem. We will update the errata page (http://www.apress.com/book/errataDisplay.html?bID=315&sID=2374) with clearer instructions.
    Albert Godfrind

  • Need sample source code for calling stored procedure in Oracle

    Hi.
    I try to call stored procedure in oracle using JCA JDBC.
    Anybody have sample source code for that ?
    Regards, Arnold.

    Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
    I have the Procedure defined as below in the SFCS1 package body
    Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
    BEGIN
    Open O_Cursor FOR
    SELECT CompanyId, CompanyName
    FROM Company
    WHERE CompanyProvince IN ('AL','AK');
    END Company_Selection;
    In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
    At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
    DECLARE
    A SFCS1.T_Cursor;
    BEGIN
    SFCS1.Company_Selection(A);
    go_Block ('Block36');
    The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause.

  • How to 100% Protect PL/SQL Code By Wrapped in Oracle Database 10g R2

    Hello,
    Is Possible to 100% Protect PL/SQL Code By Wrapped in Oracle 10g R2 ?
    If it is not possible by wrap in oracle 10g R2,
    Please, let me suggest, how i will be able to 100% protect PL/SQL code in Oracle Database 10g R2.
    Because, I have lot of functions, procedures & package's in my project.
    Which is running in field filed.
    So, i have needed to protect 100%.
    Also, will i convert to al functions, procedures & package's to .pll file ?
    And .pll file to .plx file?
    Is it possible to convert .plx file to .pll file ?
    Please, let know any better solutions in this case....
    Regards
    Mehedi

    Hello,
    No, wrapping is not a 100% secure method. It could prevent your code from amateurs, but not from professional hackers. Look at the article http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/wrap.htm#BEHGBJAA
    It says: "•Wrapping is not a secure method for hiding passwords or table names.
    Wrapping a PL/SQL unit prevents most users from examining the source code, but might not stop all of them."
    Edited by: apiminov on 03.12.2012 3:23
    Edited by: apiminov on 03.12.2012 3:24

  • Sample XML SQL to Oracle

    hi
    we need some help for a sample sql to a oracle database
    sql Plus is working
    select
           MANDT,
           VBELN,
           ERDAT
           from sapm05.vbak
           where MANDT = '100'
           and VBELN = '0000000002'
           and ERDAT = '20050430'
    when we put a sql like this (
    - <nr1:Senden xmlns:nr1="http://www.mummert.de/xi/oracle/sql">
      <dbTableName action="SELECT" />
      <table>SAPM05.VBAK</table>
      <access col1="MANDT" col2="VBELN" col3="ERDAT" />
      <key1 col1="100" col2="0000000002" col3="20050430" />
      </nr1:Senden>
    we get following error.
    #1.5#000BCD5C946C004D00000030000019E80003FB8A3D5455A1#1120996082695#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC#sap.com/com.sap.aii.af.app#com.sap.aii.adapter.jdbc.xml2sql.addAuditLog(PublicMessageKey, String, AuditLogStatus, String, String)#J2EE_GUEST#0####cfaf282bf12f11d98474000bcd5c946c#SAPEngine_Application_Thread[impl:3]_38##0#0#Error#1#com.sap.aii.adapter.jdbc.xml2sql#Plain###JDBC_ERR_403#
    #1.5#000BCD5C946C004D00000032000019E80003FB8A3D5456D6#1120996082695#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC#sap.com/com.sap.aii.af.app#com.sap.aii.adapter.jdbc.xml2sql.processList()#J2EE_GUEST#0####cfaf282bf12f11d98474000bcd5c946c#SAPEngine_Application_Thread[impl:3]_38##0#0#Error#1#com.sap.aii.adapter.jdbc.xml2sql#Plain###Structure:#
    #1.5#000BCD5C946C004D00000034000019E80003FB8A3D5457DB#1120996082695#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC#sap.com/com.sap.aii.af.app#com.sap.aii.adapter.jdbc.xml2sql.processList()#J2EE_GUEST#0####cfaf282bf12f11d98474000bcd5c946c#SAPEngine_Application_Thread[impl:3]_38##0#0#Error#1#com.sap.aii.adapter.jdbc.xml2sql#Plain###Analyzed structure:
    0.  Level 2 Name: 'dbTableName'
    #1.5#000BCD5C946C004D00000036000019E80003FB8A3D5459BB#1120996082695#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC#sap.com/com.sap.aii.af.app#com.sap.aii.adapter.jdbc.xml2sql.service(Object, Object)#J2EE_GUEST#0####cfaf282bf12f11d98474000bcd5c946c#SAPEngine_Application_Thread[impl:3]_38##0#0#Error#1#com.sap.aii.adapter.jdbc.xml2sql#Plain### error in sax handler parsing request: Error when executing statement for table/stored proc. 'null': java.lang.IndexOutOfBoundsException: Index: 1, Size: 1#
    #1.5#000BCD5C946C004D00000038000019E80003FB8A3D54DF2A#1120996082725#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC#sap.com/com.sap.aii.af.app#com.sap.aii.adapter.jdbc.XI2JDBC.onInternalMessageBinary(Binary,String,IGUID,String)#J2EE_GUEST#0####cfaf282bf12f11d98474000bcd5c946c#SAPEngine_Application_Thread[impl:3]_38##0#0#Error#1#com.sap.aii.adapter.jdbc.XI2JDBC#Plain###Error processing request, rollback:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'null': java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
         at com.sap.aii.adapter.jdbc.xml2sql.service(xml2sql.java:230)
         at com.sap.aii.adapter.jdbc.XI2JDBC.onInternalMessage(XI2JDBC.java:390)
         at com.sap.aii.adapter.jdbc.SapAdapterServiceFrameImpl.callSapAdapter_i(SapAdapterServiceFrameImpl.java:173)
         at com.sap.aii.adapter.jdbc.SapAdapterServiceFrameImpl.callSapAdapter(SapAdapterServiceFrameImpl.java:149)
         at com.sap.aii.af.modules.CallAdapterWithMessageBean.process_receiver(CallAdapterWithMessageBean.java:204)
         at com.sap.aii.af.modules.CallAdapterWithMessageBean.process(CallAdapterWithMessageBean.java:159)
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl1.process(ModuleLocalLocalObjectImpl1.java:103)
         at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:227)
         at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0.process(ModuleProcessorLocalLocalObjectImpl0.java:103)
         at com.sap.aii.af.listener.AFWListenerBean.onMessage(AFWListenerBean.java:241)
         at com.sap.aii.af.listener.AFWListenerLocalObjectImpl0.onMessage(AFWListenerLocalObjectImpl0.java:103)
         at com.sap.aii.af.ra.ms.impl.ServicesImpl.deliver(ServicesImpl.java:282)
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:825)
         at com.sap.aii.af.ra.ms.impl.core.queue.RequestConsumer.onMessage(RequestConsumer.java:112)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:447)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
    can some one help us.
    regards olaf

    Hi Olaf,
    why did you specify access, and key values as attributes?
    try looking at:
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    the example of a select statement:
    <StatementName4>
    <dbTableName action=”SELECT”>
        <table>realDbTableName</table>
    <access>
    <col1/>
    <col2/>
    <col3/> 
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName> 
      </StatementName4>
    you can also take a look at:
    RDBMS system integration using XI 3.0 JDBC Sender/Receiver adapter
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    FILE to JDBC Adapter using SAP XI 3.0
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    to see how jdbc adapters are used
    Regards,
    michal
    Message was edited by: Michal Krawczyk

  • Pls convert this piece of SQL code to oracle

    Following is the SQL code----
    Update reg_dim
    set reg_dim.Region_Description = st_reg.Region_Desc ,
    reg_dim.Process_Date = sysdate
    from st_glt_region st_reg
    left join
    Dim_Region reg_dim
    on st_reg.Region_Abbreviation = reg_dim.Region
    where reg_dim.Region is not null
    I have tried this in oracle -----
    update Dim_region_test set Dim_region_test.REGION_DESCRIPTION = (select st_glt_region.Region_Desc
    from st_glt_region left join Dim_region_test
    on Dim_region_test.Region=st_glt_region.Region_Abbreviation where Dim_region_test.Region not in null)
    group by st_glt_region.Region_Desc;
    This is executing but in Dim_region_test, REGION_DESCRIPTION column is empty
    Pls help me..................

    Something like this?
    UPDATE reg_dim
       SET reg_dim.region_description = st_reg.region_desc,
           reg_dim.process_date = (SELECT SYSDATE
                                     FROM st_glt_region st_reg LEFT JOIN dim_region reg_dim
                                             ON st_reg.region_abbreviation = reg_dim.region
                                    WHERE reg_dim.region IS NOT NULL);*009*

  • Can a PL/SQL code of timesten be called in oracle or vice versa

    Hi
    In IMDB cache setup with AWT cache group , the pl/sql code or procedure that is written in oracleDB can it be called in TimesTen and vice versa
    example: In a stored procedure the DML's that are performed will be updating the cache tables and log table in oracleDB.
    Will there be any performance impact.
    Regards
    Siva Kumar

    A PL/SQL procedure can exist in Oracle DB, in TimesTen, or in both. You control that by where you create the procedure. Procedures that exist in Oracle can really only be called in Oracle and can only access data in Oracle. Procedures that exist in TimesTen can only be called in TimesTen and can only access data in TimesTen. There is a limited capability, using the TimesTen PassThrough capability to call PL/SQL procedures located in Oracle, from Timesten, and for Timesten PL/SQL procedures to access data in Oracle. Using PassThrough does have some overhead.
    Chris

  • Oracle Spatial operator SQL statement help

    I have a 3D elevation point feature class (elev) and a polygon feature class (Building) loaded in Oracle Spatial. I am trying to update the "HEIGHT" attribute of the "Building" Feature class using the average elevation of "elev" feature class. Here below is the SQL statement I used, which generated the same value for all buildings. The avg(elevation) returns the average elevation of all points within all building polygons, not all points within ONE polygon.
    Please help and thanks.
    update building
    set height = (select avg(elevation)
    from elev e, building b
    where sdo_anyinteract(e.shape, b.shape) = 'TRUE');

    Hi,
    try this
    update building b
    set height = (select avg(elevation)
    from elev e where sdo_anyinteract(e.shape, b.shape) = 'TRUE');
    Udo

  • To run a piece of PL/SQL code,  in TT  is much slower than   in ORACLE.

    A piece of PL/SQL code , about 1500 lines, package is named rtmon_event, function in it is named rtmon_SHOLD_CUS_RPT;
    the PL/SQL code is run in ORACLE.
    Now I want to get fast speed, I think of TT.
    I rewrite the PL/SQL code by grammer in TT.
    But the speed in TT is much slower than the speed in ORACLE.
    In ORACLE, to run the PL/SQL code, it need 80 seconds; but In TT, to run the PL/SQL code, it need 183 seconds;
    How can I resolve the problem?
    Btw: there are some joins of 2 tables, or 3 tables in rtmon_event.rtmon_SHOLD_CUS_RPT, and some complex DML in it.
    The run method is :
    declare
    a number;
    begin
    a := rtmon_event.rtmon_SHOLD_CUS_RPT ;
    end;
    Thanks a lot.

    The easiest way to view a plan is to use ttIsql and issue the command:
    explain SQL-statement;
    For example:
    explain select a.ol1, b.col2 from taba a, tab b where a.key = b.key;
    See the documentation that 'hitgon' pointed you to to help you interpret the plans.
    Chris

  • PL/SQL website with sample PL/SQL codes from real life examples

    Hi All,
    Can any one guide me and suggest me on the website where they post sample PL/SQL code. Thanks much in advance.
    AL

    Something like this ->
    UPDATE PRODUCT e
    set e.new_id = (
                      SELECT distinct i.id||i.code
                      FROM item i, product pi
                      WHERE i.ccode = '12'
                      AND i.scode = 'ACTIVE'
                      AND i.id IS NOT NULL
                      AND pi.id = i.id
                      AND i.id IN (
                                      SELECT DISTINCT ri.item_id
                                      FROM category ri
                                      WHERE ri.category_code = 'RRR'
                      AND pi.id = e.id
    WHERE e.new_id IS NULL;N.B.: Not tested...
    Please post your table structure. Otherwise it is very difficult to find out the exact reason.
    Regards.
    Satyaki De.

  • Execute all SQL code as individual Oracle user, not APEX_PUBLIC_USER

    Is it possible to get APEX to execute SQL code as the user's existing Oracle database user instead of APEX_PUBLIC_USER?
    Besides having all of the security already defined for each of the existing users at the database level, the existing application also handles generating audit trails with triggers that pull the username executing the SQL instead of accepting passed values. At the moment APEX_PUBLIC_USER is plastered everywhere as the user that generated the changes.

    rcy_evdriver wrote:
    Is it possible to get APEX to execute SQL code as the user's existing Oracle database user instead of APEX_PUBLIC_USER? No. See:
    {message:id=926724}
    {message:id=1224601}
    {message:id=1606515}
    Application Express and parsing of SQL
    Besides having all of the security already defined for each of the existing users at the database level, the existing application also handles generating audit trails with triggers that pull the username executing the SQL instead of accepting passed values. At the moment APEX_PUBLIC_USER is plastered everywhere as the user that generated the changes.Using DAD Credentials Verification will cause the database user to be returned by the <tt>USER</tt> pseudo-column. (However just because you can do this, it doesn't mean you should.)
    {message:id=9680421}
    Why are you asking this? +"At the moment APEX_PUBLIC_USER is plastered everywhere as the user that generated the changes"+ indicates that it might be a bit late to be making fundamental discoveries about APEX and database security?

Maybe you are looking for