Oracle PL/SQL using decode/case in the subquery

SELECT DISTINCT E.ACC_ID,
P.EFFECTIVE_DATE,
P.UPDATE_DATE
(CHOOSE abc.def table in case RECON_ACC.partition_id is 1 for this acc_id
abc100.def if RECON_ACC.partition_id 2 table for this acc_id
) p
JOIN IN-HOUSE
(select * from RECON_ACC where id_partition is NOT NULL) e
ON P.ACC_ID = E.ACC_ID
AND TRUNC (P.UPDATE_DATE) > = December 31, 13 '
AND TRUNC (P.UPDATE_DATE) < = 2 January 14 ';

Can someone help me to do a SQL query to do this?

Hello

If you had only a table of def, then it would be easy

.  You need only a simple join, like this:

SELECT ud.acc_id, ud.effective_date, ud.update_date

Of unified_def ud

JOIN recon_acc r ON ra.partition_id = ud.partition_id

AND ra.acc_id = ud.acc_id - can - be

;

The only problem here is that you have 2 separate tables def.  Assistance from the UNION, you can create a result set that makes these 2 tables appear as 1; for example:

WITH date_range AS

(

SELECT TO_DATE (November 1, 2013 00:00:00 ', 'HH24:MI:SS of Mon-DD-YYYY') AS first_date

, TO_DATE (November 20, 2013 23:59:59 ', 'HH24:MI:SS of Mon-DD-YYYY') AS last_date

OF the double

)

unified_def AS

(

SELECT d1.effective_date, d1.update_date, d1.acc_id

1 AS id_partition

To abc_def d1

JOIN date_range r1 WE d1.update_date BETWEEN r1.first_date

AND r1.last_date

UNION ALL

SELECT d2.effective_date, d2.update_date, d2.acc_id

2 AS id_partition,

Abc100_def D2

JOIN date_range r2 WE d2.update_date BETWEEN r2.first_date

AND r2.last_date

)

SELECT ud.acc_id, ud.effective_date, ud.update_date

Of unified_def ud

JOIN recon_acc r ON ra.partition_id = ud.partition_id

AND ra.acc_id = ud.acc_id - can - be

;

I called def small tables abc_def and abc100_def, just so I wouldn't have to create new patterns.  Replace your real names when you run this.

I added the subquery date_range as a means of conveying the date settings.  You can do something else, bind variable may be.

I guess just in between the recon_acc and other tables join conditions.  Do you still need recon_acc at all with this problem?

Once more, this problem only occurs because you have 2 separate tables def.  Why you store your data in a way that creates problems?  Is there a reason why you can't use only 1 table unified_def?

Tags: Database

Similar Questions

  • PL/SQL, used in application of the APEX of unit tests

    question by my client:

    I develop an Oracle Application Express application and work on unit tests for stored procedures in PL/SQL and the packages that are stored in the underlying database and used by the application of the APEX. These unit tests must run in the context of SQL Developer Unit Test.
    The problem is that the PL/SQL code stored in the database using functions such as NV('APPLICATION_ITEM') to access items in the application of the apex. They do return all values when I try to execute the PL/SQL within the unit test framework, that is to say in the backend. While it is good that the NV is not error, NULL haven't really work well in my scenario either (for example when the result of this function is inserted into a column NOT NULL in a table). I can think of a few workarounds, such as the creation of my own function NV within the schema to test return values desirable, but nothing seems a really satisfactory solution. I wonder if there is no recommendation to Oracle for this scenario - how can I run code that uses the APEX via backend-specific features. I found nothing in the documentation of the APEX for this but I would like to know if there is a recommendation how to better deal with this case.

    I use SQL Developer version 4.0.0.13.80

    Hello

    Indeed, you must set your PL/SQL function calls. This would be the cleanest solution.

    There is an alternative. Please see the following article on the creation of an APEX in PL/SQL session: Martin Giffy D'Souza on Oracle APEX: how to create a Session of the APEX in PL/SQL

    This approach allows to set the values of APEX application item before you run your unit tests. I don't know if it's possible in SQL Developer Unit Test, but it might get you further down the road.

    Good luck

    Nick

  • Can Oracle 10g - I use a variable for the access of the user identifywhat tablesto?

    I have the following code in a trigger (PL/Sql block) of a form:

    Select fieldname in user1.sometable myvar;

    is it possible to use a variable instead of coding hard "user1"? And on the same subject, this variable would also be declared in the world?

    Thanks in advance,
    Darren

    Hello!

    User1 is the owner of the table sometable.

    If only the User1 runs your form, there is no need to put the tableowner in front of the tablename parameter.

    If other users run your form, you must create a public or private (for each user) synonym of this table.
    After that, you don't need to use owner.tablename in your sql statement.

    But:
    You cannot use a variable for the user name without using dynamic sql
    as you do if you create a recordgroup.

    Concerning

  • Dblink Oracle to sql server, multiple database on the same server sql under a dblink

    Hi, we managed to set up an Oracle dblink to sql server and retrieve data.

    The user of sql server have been using via dblink has access to multiple databases on the same sql server

    But the question is how in oracle (if possible) prepend you the SQL access to this?

    For example:

    Sqlserver_prod has the user sqlserver_user which seems to be set up as default database sqlserver_db1

    But we have select access to sqlserver_db2

    all work well as sqlserver_user

    Select * from table_fromdb1

    Select * from dbo.table_fromdb1

    Select * from sqlserver_db1.dbo.table_fromdb1

    as does

    Select * from sqlserver_db2.dbo.table_fromdb2

    more in Oracle

    Oracle_db a dblink sqlserver_prod. World connection sqlserver_user

    everything works fine

    Select * from 'table_fromdb1"@sqlserver_prod '.

    Select * from 'dbo '. "table_fromdb1"@sqlserver_prod

    But how to (if possible) access from oracle

    sqlserver_db2.dbo.table_fromdb2

    without having to create a new sqlserver_db2_user referenced in a new dblink

    If oracle for oracle would be

    Select * from remote_oracle_schema.table@remote_oracle_db

    Hello

    You cannot select a table in a different SQL * database server from that to which the gateway instance connects.
    As stated in the documentation-

    Oracle® database gateway

    Installation and Configuration Guide

    11g Release 2 (11.2) for AIX 5 L Based Systems (64-bit), HP - UX

    Itanium, Solaris (SPARC 64-Bit), Linux x 86 operating system,

    and Linux x 86-64

    In the section.

    The example SQL Server multiple databases: Configuration of the modem router

    A separate instance of the gateway that is required for each SQL Server database. Each

    instance needs its own Gateway system ID (SID).

    ==========

    You will need to create a new instance of the gateway for the SQL * Server DB2 as well as a link separate db.

    Kind regards

    Mike

  • You can buy and 2 Air iPad smart case and use this case for the new iPad 9.7 Pro?

    can you get an iPad 2 case Air and use it for the new iPad 9.7 Pro

    You should be able to. Both devices have the same accurate external characteristics. I think that the physical difference is that the Pro 2 has 4 speakers and 2 Air has two. (Pro has two on top, two on the bottom, 2 Air just has two on the bottom)

    Yes, as long as the case is not "blocking the speakers or you don't care (I use only headphones with my iPad so I don't care if the speakers have been blocked)"

  • Query SQL using Group by and the aggregate function

    Hi all

    I need your help in writing a SQL query to achieve the following objectives.

    Scenario:

    I have a table with 3 columns. There are 3 possible values for col3 - success, failure, and error.
    Now I need a query that can give me the summary figures for distinct values for col3 for each GROUP BY col1 and col2 values. When there is no values for col3, then it should return ZERO count.

    The example data:

    Col1 Col2 Col3

    success of ABC 01
    success of ABC 02
    success of ABC 01
    ABC 01 failure
    ABC 01 error
    ABC 02 failure
    ABC 03 error
    XYZ 07 failure

    Power required:

    C1 c2 s_cnt F_cnt E_cnt (title)
    ABC 01 2 1 1
    ABC 02 1 1 0
    03 0 0 1 ABC
    XYZ 07 0 1 0

    s_cnt = number of success; F_cnt = number of failure; E_cnt = number of errors

    Please note that the exit should have 5 columns col1, col2, group of (col1, col2) count (success), group of (col1, col2) count (failure), group of (col1, col2) count (error)
    and wherever there are n ROWS, then it should return ZERO.

    Thanks in advance.

    Kind regards
    Shiva

    Hi, Shiva,

    Welcome to the forum!

    Here's one way:

    SELECT       col1
    ,       col2
    ,       COUNT ( CASE
                          WHEN  col3 = 'success'
                    THEN  1
                      END
                 )          AS s_cnt
    ,       COUNT ( CASE
                          WHEN  col3 = 'failure'
                    THEN  1
                      END
                 )          AS f_cnt
    ,       COUNT ( CASE
                          WHEN  col3 = 'Error'
                    THEN  1
                      END
                 )          AS e_cnt
    FROM       table_x
    GROUP BY  col1
    ,            col2
    ;
    

    Whenever you have a problem, post a small example data (CREATE TABLE and only relevant columns, INSERT statements). If you do not, then don't expect answers, you can get to test.
    Also post the results desired from these data.

  • XMLFile parameter is not supported by Oracle APEX, please use the setXMLFile() method

    "XMLFile parameter is not supported by Oracle APEX, please use the setXMLFile() method.

    I created a test web app in apex.oracle.com to try a few things. I created a Flash 2D pie chart in a Web page, and it seems to make very well. But before rendering, I get the error message above, on the region of graph for 1-2 seconds.

    Can anynone tell me what means the error message above and why I'm getting this. I do not use a custom XML part. Has not changed the default settings of the chart area.

    I could see above the error appearing clearly since the apex.oralce.com is so slow... and graphics region takes awhile to load. Otherwise I could not have noticed. It happens in the IE8 and Google chrome.

    Oralce Apex 4.2.5.00.006 (https://apex.oracle.com)

    Google Chrome 34.0.01847.116

    Internet Explorer 8.0.6001.19518

    Can anyone help please. I'll try to become a test application setup dispalying this awhile earlier error message.

    I used HTML5 graphics in apex 4.2.0.00.27 in my office in my real application workspace. Most of my users still use IE8. HTML5 graphics all appeared well in their IE8 browser. One fine day, some parameters must be changed by my network administrator or soemthing else could have happened. I have no idea. My webapplication HTML5 graphics disappear IE8 users. IE9 users had no problem. I contacted our IT support staff of any changes to security settings that day, or earlier. Absolutely no help from my frustration. I have to change maps of my application (only about 6 of them) to the Flash graphics to overcome this obstacle. This is the story behind why I use Flash cards. If anyone has experienced a similar problem in IE8 HTML5 graphics please shed any light for me... This problem may be nothing to do with the "XMLFile parameter error message', but I'm not sure.

    You strike again BUG introduced with Oracle Application Express 4.2.5

    http://www.Oracle.com/technetwork/developer-tools/Apex/application-express/Apex-425-known-issues-2186292.html

    18601802 - ANYCHART XMLFILE WARNING DISPLAYED BEFORE FLASH GRAPHICS RENDERING when Flash graphics that take a long time to make, the user can see the following warning message appears briefly "XMLFile parameter only is not supported by Oracle APEX, please use setXMLFile() method.» The table will be always delivered. Solution: Please advise end-users to ignore the message.

  • error - error 103 6i form met the case of the symbol

    Hello

    I'm in the Form 6i, in the program, I had given the following query where I get an error message. Please see below for queries and screenshot

    slider c3 is select canworkorder.workorderno, sum (case when canptn.fgstat is null then canptn.ptnqty end) intqty

    , sum (case when canptn.fgstat is not null then canptn.ptnqty end) ptnqty

    , min (canptn.ons) Add-ons canworkorder, canptn where canworkorder.pendingqty > 0

    and (canworkorder.workorderno = canptn.workorderno) and canworkorder.pendingqty > 0

    Canworkorder.workorderno group;

    form6i.jpg

    Sandy

    Dear Sir

    Case is not supported by forms. You have 2 options,

    (1) using DECODE instead of the CASE.

    (2) record by using the same query (either design or using CREATE_GROUP_FROM_QUERY) group to create and loop through the record group.

    Manu.

  • difference between the incremental update of the IKM oracle and incremental update IKM oracle (PL - SQL)

    Hello

    What is the difference between the incremental update of the IKM oracle and updated incremental IKM oracle (PL - SQL) and incremental update IKM oracle (line by line).

    Thank you

    Papai

    The only difference is that the second using plsql for incremental update. He also to manage clob issues well enough.

    If you need to know more you can read the description of each KM section.

    Incremental update IKM Oracle (PL-SQL)

    -------

    Description:

    -Knowledge integration module

    -Integrates data into an Oracle table from target in incremental update mode using PL/SQL.

    -Non-existent rows are inserted. already existing lines are updated.

    -Data can be controlled. Data invalid are isolated in the error Table and can be recycled.

    -This KM uses PL/SQL to perform the inserts and updates until and blob columns are supported. Please see the restrictions.

    -When you use this module with a source table logged, it is possible to synchronize the deletions.

    Restrictions:

    -When working with the logged data, if the "synchronize destruction of the newspaper" are executed, the lines deleted on the target are engaged

    -The data are updated even if not changed (upgrade from any (e)

    -The number of lines (number of inserts/changes) is not available because the transactions are performed using PL/SQL

    -Comparison of the data is performed using the key to update defined in the interface. It must be set.

    -L'option TRUNCATE does not work if the target table is referenced by another table (foreign key)

    -Options FLOW_CONTROL, and STATIC_CONTROL call the Module knowledge check to isolate invalid data (if no CKM is defined, an error occurs). These two options should be set to NO in the case where an integration Interface meets a TEMPORARY target data store.

    -L' FLOW_TABLE_OPTION option is set by default to NOLOGGING. Set it to a space if the interface is running on an Oracle 7 database

    -Deletions are committed regardless of the VALIDATION option

    Incremental update of the IKM Oracle

    -------------

    DESCRIPTION:

    -Integrates data into an Oracle table from target in incremental update mode.

    -Non-existent rows are inserted. already existing lines are updated.

    -Data can be controlled. Data invalid are isolated in the error Table and can be recycled.

    -When you use this module with a source table logged, it is possible to synchronize the deletions.

    REQUIREMENTS:

    -The update key defined in the interface is required.

    RESTRICTIONS:

    -When working with the logged data, if the "synchronize destruction of the newspaper" are executed, the lines deleted on the target are engaged

    -L'option TRUNCATE does not work if the target table is referenced by another table (foreign key)

    -Options FLOW_CONTROL, and STATIC_CONTROL call the Module knowledge check to isolate invalid data (if no CKM is defined, an error occurs).

    These two options should be set to NO in the case where an integration Interface meets a TEMPORARY target data store.

    -L' FLOW_TABLE_OPTION option is set by default to NOLOGGING. Set it to a space if the interface is running on an Oracle 7 database

    -Deletions are committed regardless of the VALIDATION option

    -L' ANALYZE_TARGET option will allow to assess correct statistics only if the VALIDATION is set to Yes. Otherwise, the IKM gather statistics based on old data.

    -Default UPDATE option is TRUE, which means by default it is assumed that there is at least one column nonkey specified in a target data store.

  • Number of databases such as Oracle and SQL Server in the same application ADF

    Hello

    In my application, I need to use two different databases such as Oracle and SQL Server. There are screens that I need to develop in the ADF where I need to involve fields of the tables in these two different databases. I just want to know - is it possible to do so in application of the ADF?

    Or to create a sort of link between these databases in the backend? Then create a view object involving some distributed SQL queries. What can I do with this type of request than anything? I mean, can I use the two insert or update operation using this VO?

    Or y at - it another way to do this?

    Please help, help here would be really appreciated. I've been stuck with this problem for a while now. I did search our forums for the same problem, but was not able to find a reliable solution.

    Thank you
    Vijay

    It's still not clear to me if you need two db tables in a query, or a transaction.
    If this is the case, your best option (to my knowledge) is to use a db link. in this way, you only need to access (for example the oracle db) and can access the objects from the other data from the oracle database.
    I don't understand
    >
    (3) a model project with a meeting of the two datasource. I selected a data source and created OT and VO. When I have selected a different data source and select tables to create VO and EO and finished but these EO and VO is displayed in project. >

    (2) If you need to link data from these two dbs you can not use this approach (see the note at the top of the post)

    Timo

  • Peovisioning attribute to multiple values in a table SQL using the GTC in detail

    I have a recon trust implemented Sun LDAP for IOM followed to auto put into service at table 'MyUser' to SQL using GTC. It works great so far.

    Now the difficult part of the requirements. I have a multivalued attribute called "AppRoles" associated with Sun's LDAP user. I would like access to this attribute to the 'MyUserToRole' of SQL table (this is a picture of detail table Master "MyUser"). What should be the best approach to this task?

    Thank you!
    Kabi

    For the look-up:
    Once you run Trusted Recon, all your AppRoles are inserted in this research and the different lines for different users. Use the IOM API for this. A basic structure could be as follows:

    Code - Decode
    User01 - Role01, Role02
    User02 - Role02, Role03, Roel04
    User03 - Role08, Role12

    In this way all the roles are stored in this research. Bu the only problem with it could be the change in the look upwards manually which could be tolerated as there are glitches with almost all of the solutions implemented.
    --------------------

    For the field of the UDF
    Yes, their would be a limitation in the text box and it is * 200 * characters. So if that's the case then you should go for the look-up which has no such restrictions at least for your condition.

  • suspension and resumption of a proc to the tool DEVELOPER oracle PL/SQL, PL/SQL

    I need to test a PL/SQL on how it reacts to an exception. I need to PAUSE, do something outside of the proc and then resume the proc. Is there a command PROMPT in PL/SQL where he would wait for user input? Can I use DBMS_OUTPUT. GET_LINE to do this? Where is raed GET_LINE entry of?

    user4900730 wrote:
    The INSERT will wait forever?

    Yes - the lock has been created by the 1st session needs to be released. This is done by a commit or rollback - or something like kill this session which will result in an automatic cancellation.

    Remember that it is an application problem. Oracle must simply ensure that the primary key is not violated. It is the application that has decided the how/what/where/when to insert the data.

    The only time where Oracle will intervene in this regard is when it detects a deadlock. It is an infinite hung - so Oracle will select one of the sessions involved in the deadlock and kill him. This lead to a cancellation of this session and will allow the other session attached to continue.

    This error is stored in the instance's alert log file and a trace file is created - and also marked as an application problem which must be solved at the level of the application.

    If yes then I never need to test the duplicates on the VALIDATION. If the waiting is over and oracle allows session B to continue beyond the insert (with the record inserted in homogeneous image read B) so if one commits before B Gets the commit B can get a PK violations on validating DUP?

    No, a process can continue pass a lock. She can try the lock with "+ no waiting +"-in which case when he fails to lock, it will not be queued for the lock, but rather throw an exception.

    You must decide at the application level, how you're going to deal with this. You wait for access to the line of change/insert? You use without waiting? This framework is an architecture decision. Client-server standard with a dedicated dynamic customer, you can expect. With a Webmail client-server having a customer without a State, you cannot afford to wait.

    It is much simpler than in other Oracle databases. Readers do not block writers. Writers do not block readers. Writers can only block other Scriptures when pretending to write the same data (rows). Thus, you should only have to worry about writing the data of same (and no lock escalation, or readers, writers, etc. of blocking as is the case in other RDBMS products).

    Is there any place in the oracle documentation that deals with this.

    [Concepts of Oracle® database | http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/consist.htm#i13945] has a section on to data concurrency and consistency.

  • How can I access other demo sample such as sh (sales history) patterns similar to hr &amp; oe I use to study for the exam SQL?

    I installed Oracle 12 c database on my Tablet Windows Pro 8.1 and I chose to install demo (sample) patterns in an additional download of oracle.com/downloads.  Then, on the instruction of the book corrected Oracle, I've unlocked users 'HR' and 'oe' using the following commands:

    ALTER user HR account unlock identified per hour;

    ALTER user oe account unlock identified by oe;

    I've been connecting to connections HR and oe to write and execute sql commands following fundamentals of SQL as well as the book in preparation for the exam successfully.  Now, in Chapter 10 of the book, he mentions the "sh" (historical sales) pattern.  I tried to launch a slight spin on orders above change/unlock to unlock the 'sh' user when logged in sysdba, but I get an error message indicating that the user "sh" is not found.  So I've navigated to the .sql file sh_main.sql and opened it with SQL Developer to run it, but it requires parameters that are not in the book, as if they were in Chapter 1 of 'oe' and 'hr '.  I know put sh as password, USERS, TEMP and V3 for version, but I do not know the path of log file to use (or type as a parameter).  Maybe I go about it the wrong way at this point?  It is not as simply by running the command user unlock, because it does not recognize the "sh" user even if that user exists in the directory tree under connect sysdba "other users".

    What am I supposed to do to connect to the less common, but still useful demo schema "sh" (sales history)?

    Thank you

    Heather

    It works well for me.

    BTW in V11 + passwords are CaSeSenSiTive

    SQL > select username from dba_users where username like 'P % ';

    USERNAME

    ------------------------------

    PHPDEMO

    PLS

    PM

    SQL > account user PM ALTER unlock identified by PM;

    Modified user.

    SQL > connect h/h

    ERROR:

    ORA-01017: name of user and password invalid. connection refused

    WARNING: You are more connected to ORACLE.

    SQL > connect h/h

    Connected.

    SQL > USER TO SEE THE

    The USER is "PM".

  • Oracle of the MAF error ' cannot read the DataControl uses on loadDataControl for the id:

    Need help!

    I created a simple SOAP web service for a remote database that works very well in 12 c WebLogic Server and also in the Jdeveloper HTTP Analyzer. When I use the same web service in the attached code, I get the following error (I've included output System.out.println in Ref. to the flow of the code) I use Jdeveloper 12 c MAF 2.0.0.0.41 on Mac OSx 10.9.

    Chk #0

    Processing line # 1

    Chk #1

    Chk #2

    [SEVERE - oracle.adfmf.framework - AmxBindingContext - loadDataControlById] Cannot read the DataControl uses on loadDataControl for the id: WLFNewActWS. [SEVERE - oracle.adfmf.framework - SynchronizationDC - syncDataFromOfflineToOnline] [Ljava.lang.StackTraceElement;@467c53d3

    @


    Sorry about that, I think I'm wrong you.

    OK, I created an example to test what goes wrong.

    1. server side, create a project named Employee_ws

    a. Department_ws.java

    public interface {Department_ws}

    public boolean addDepartment (a Department);

    }

    b. Department.java

    public class {Department

    public Department() {}

    Super();

    }

    int departmentId.

    String departmentName;

    locationId int;

    managerId int;

    {} public void setDepartmentId (int departmentId)

    this.departmentId = departmentId;

    }

    public int getDepartmentId() {}

    return departmentId.

    }

    {} public void setDepartmentName (String departmentName)

    this.departmentName = departmentName;

    }

    public String getDepartmentName() {}

    return departmentName;

    }

    {} public void setLocationId (int locationId)

    this.locationId = locationId;

    }

    public int getLocationId() {}

    return locationId.

    }

    {} public void setManagerId (managerId int)

    this.managerId = managerId;

    }

    public int getManagerId() {}

    return managerId;

    }

    }

    c. Department_impl.java

    @WebService

    / public class Department_impl implements Department_ws {}

    public Department_impl() {}

    Super();

    }

    @Override

    @WebMethod

    {} public boolean addDepartment (@WebParam (name = "arg0") a Department)

    If (Department! = null) {}

    int departmentId = department.getDepartmentId ();

    String departmentName = department.getDepartmentName ();

    int locationId = department.getLocationId ();

    managerId int = department.getManagerId ();

    Connection Conn;

    try {}

    Conn = ConnectionFactory.getConnection ();

    conn.setAutoCommit (true);

    Statement šment = conn.createStatement ();

    String inset_sql =

    "INSERT INTO dept (department_name, location_id, department_id, manager_id) VALUES ('+ '.

    departmentId + "," "" + departmentName + "'," + locationId + "," + managerId + ")";

    šment. Execute (inset_sql);

    Returns true;

    } catch (Exception e) {}

    System.out.println (e);

    }

    }

    Returns false;

    }

    }

    d. ConnectionFactory.java

    import java.sql.Connection;

    to import java.sql.DriverManager;

    import java.sql.SQLException;

    Connect to the database

    public class {ConnectionFactory

    public ConnectionFactory() {}

    Super();

    }

    protected static connection conn = null;

    public static connection getConnection() bird Exception {}

    If (conn == null) {}

    try {}

    String driver = "oracle.jdbc.driver.OracleDriver";

    String url = "jdbc:oracle:thin:@localhost:1521:orcl";

    User String = "employee";

    String password = "employee";

    Class.forName (driver);

    Conn = DriverManager.getConnection (url, user, password);

    } catch (SQLException e) {}

    System.Err.println (e.getMessage ());

    }

    }

    return conn;

    }

    public static {} Sub closeConnection()

    try {}

    If (conn! = null) {}

    Conn.Close ();

    Conn = null;

    }

    } catch (Exception ex) {}

    throw new RuntimeException (ex);

    }

    }

    }

    You can run Department_impl.java to start the Web service. i.e. http://127.0.0.1:7001 / Employee_ws-Client-context-root/Department_implPort? WSDL

    Server side sql:

    CREATE USER employee IDENTIFIED BY employee DEFAULT TABLESPACE users

    Temp TEMPORARY TABLESPACE

    Users WE QUOTA UNLIMITED;

    GRANT create employee to logon.

    GRANT alter used to logon.

    GRANT create any employee at table;

    GRANT create trigger employee TO;

    GRANT create any employee to view;

    GRANT create sequence employee TO;

    GRANT create synonym employee TO;

    GRANT create type employee TO;

    GRANT create employee to procedure;

    CREATE TABLE (DEPT

    DEPARTMENT_ID NUMBER (7, 0) NOT NULL,

    DEPARTMENT_NAME VARCHAR2 (50).

    NUMBER OF LOCATION_ID (7, 0),

    MANAGER_ID NUMBER (7.0)

    );

    2 create a mobile application of CRG named Dept

    a. Department.java (even for the server)

    b. SynchronizationDC.java

    import java.util.ArrayList;

    import java.util.List;

    Import oracle.adfmf.framework.api.AdfmfJavaUtilities;

    Import oracle.adfmf.framework.exception.AdfInvocationException;

    public class SynchronizationDC {}

    public SynchronizationDC() {}

    Super();

    }

    public void syncDataFromOfflineToOnline() {}

    It's just for testing, so I build Department manually instead of mobile db data, please replace in your business logic

    A Department = new Department();

    department.setDepartmentId (1);

    department.setDepartmentName("1");

    department.setLocationId (1);

    department.setManagerId (1);

    NamesList list = new ArrayList (1);

    List ParamsList = new ArrayList (1);

    List TypesList = new ArrayList (1);

    namesList.add ("arg0");

    paramsList.add (department);

    typesList.add (Department.class);

    try {}

    AdfmfJavaUtilities.invokeDataControlMethod ("Dept_WS", null, "addDepartment", namesList, paramsList,

    typesList);

    } catch (AdfInvocationException e) {}

    System.out.println (e);

    }

    }

    }

    c. new an AMX pag called Dept.amx

    "http://www.w3.org/2001/XMLSchema-instance" xmlns:amx ="http://xmlns.oracle.com/adf/mf/amx"

    xmlns:dvtm ="http://xmlns.oracle.com/adf/mf/amx/dvt" >. "

    Text = "syncDataFromOfflineToOnline."

    Disabled = "#{!}" Bindings.syncDataFromOfflineToOnline.Enabled}"id ="cb3"/ >

    d. deploy on Android Simulator

    Click the button and a new record have been db insert through the webservice, search the remote db recording

    If above does not solve your problem, please let me know, thanks.

    Byron

  • Anonymous performer of Oracle PL/SQL in the Production environment leave a residue?

    Hello

    In my project, we have a large PL/SQL in Prod-Replica Envt to generate scripts. However, to reproduce Prod for this Prod-Replica lasts long and is causing a delay to respond to change requests.

    We have READ ONLY access to Prod DB, but we cannot deploy the PL/SQL Package it. We plan to convert the PLSQL in an anonymous block PLSQL and running it in PROD DB to get real data. Alternatively, we can run it directly or via Java and then read the DBMS output later. as mentioned here-> the use of cursors and results in Oracle PL/SQL, Java/JDBC - Stack Overflow

    , However, is not an expert in PL/SQL, I wanted to know, if it leaves residues in PROD outside the additional load a temporary server for read queries. We only select queries in this PL/SQL and so I donot believe we leave triggers or change the DB somehow.

    Can you please let me know the possible consequences of it.

    -Thanks & Regads

    -Scott

    There will be an impact on the server, the conversion of code unit of PL/SQL (procedures and functions) must be encapsulated in a single code PL/SQL anonymous block.

    This anonymous PL/SQL code block needs to be parsed and compiled - burn a lot of CPU (that oppose the use of unit code already compiled PL/SQL).

    This anonymous PL/SQL block is likely to be very large because it contains too many units of PL/SQL source code. This needs memory to the server as the whole code block will be stored in the shared pool (for analysis).

    Another impact on performance would be wise to network. It requires more bandwidth to transfer this big block of code (created by the customer) to the Oracle server. This increases latency. And is not an evolutionary approach.

    So no, there is no "residue" of the code inside the actual physical database code is never stored in the database. However, this approach and the code will affect negatively network and server resources.

    You should consider the problem and determine if this solution you have in mind, justifies this impact.

Maybe you are looking for

  • Updates will not configure Win 7 64 bit

    Windows Update will download updates of Win 7 will not configure them. After the reboot it will configure at 15% and then I get an error message that says: "failed to configure updates. To eat.  Windows 7 64 bit I sent a support email, but they canno

  • error code 80040006 during the installation of windows live essentials on windows 7.

    I have a new computer and I'm trying to get everything to work right. We manage the reception of windows 7 pro 64-bit. I am trying to download the updates, and they are all worked well until I got to the windows live essentials. they all fail repeate

  • Security log is full, how do fix you this?

    I turned on my PC of the net fiber broadband.  It gives me this log on when I started using fiber NET after 2 weeks?

  • Switch Audio device without rebooting between computer and TV.

    Switch Audio device without rebooting Hello I have a HD TV hooked like a monitor to my desktop via a HDMI cable to a HD video card. The video works wonderfully, but for some reason, the sound goes is more easily. I used to be able to simply change th

  • AC1600 slow Wi - Fi speed and

    Hello I just buy a smart WiFi AC1600 router model. The speed on my router is 3 times as slow as what comes from my MTA of the cable company. I have reinstall my firmware and restarted it several times, but the best I can get is 6 Mbps downstream, whi